Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/spotty-lilies-shout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@skillsoft/gamut': minor
'@skillsoft/gamut-agent-tools': minor
---

Update props to use start/end in place of left/right
4 changes: 2 additions & 2 deletions packages/.storybook/argTypes/closeButtonProps.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const tipAlignmentOptions = [
'top-center',
'bottom-center',
'left-center',
'right-center',
'start-center',
'end-center',
] as const;

export const closeButtonPropsArgTypes = ({
Expand Down
6 changes: 3 additions & 3 deletions packages/.storybook/argTypes/infotip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ export const infotipNestedArgTypes = {
},
'infotip.alignment': {
control: 'radio',
options: ['bottom-left', 'bottom-right', 'top-left', 'top-right'],
options: ['bottom-start', 'bottom-end', 'top-start', 'top-end'],
table: {
defaultValue: { summary: 'top-right' },
type: { summary: 'bottom-left | bottom-right | top-left | top-right' },
defaultValue: { summary: 'top-end' },
type: { summary: 'bottom-start | bottom-end | top-start | top-end' },
},
},
'infotip.placement': {
Expand Down
2 changes: 1 addition & 1 deletion packages/.storybook/components/Elements/ImageGallery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export const ImageGallery: React.FC<ImageGalleryProps> = ({
>
<Image width={imageSize} height={imageSize} />
</MotionBox>
<StyledText fontSize={14} textAlign="left" width="auto">
<StyledText fontSize={14} textAlign="start" width="auto">
{name}
</StyledText>
</MotionFlexBox>
Expand Down
1 change: 1 addition & 0 deletions packages/code-connect/Atoms/Anchor.figma.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ figma.connect(
false: undefined,
}),
}),
// TODO: [GMT-1297] Update these 'left' / 'right' values to 'start' / 'end' after the Figma changes take effect.
iconPosition: figma.boolean('👁 leading icon', {
true: 'left',
false: figma.boolean('👁 trailing icon', {
Expand Down
1 change: 1 addition & 0 deletions packages/code-connect/Atoms/Drawer.figma.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ figma.connect(
'https://www.figma.com/design/ReGfRNillGABAj5SlITalN/%F0%9F%93%90-Gamut?node-id=115820-91241',
{
props: {
// TODO: [GMT-1297] Update these 'left' / 'right' values to 'start' / 'end' after the Figma changes take effect.
alignContentContainer: figma.enum('alignContentContainer', {
left: 'left',
right: 'right',
Expand Down
1 change: 1 addition & 0 deletions packages/code-connect/Atoms/FormGroup.figma.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ figma.connect(
true: figma.textContent('description'),
}),
toolTipInfo: figma.nestedProps('.infotip-alignment', {
// TODO: [GMT-1297] Update these alignment values to their 'start' / 'end' equivalents after the Figma changes take effect.
alignment: figma.enum('alignment', {
'top-left': 'top-left',
'top-right': 'top-right',
Expand Down
1 change: 1 addition & 0 deletions packages/code-connect/Atoms/FormInputs/Radio.figma.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ figma.connect(
emphasis: figma.enum('emphasis', { low: 'low', high: 'high' }),
}),
toolTipInfo: figma.nestedProps('.infotip-alignment', {
// TODO: [GMT-1297] Update these alignment values to their 'start' / 'end' equivalents after the Figma changes take effect.
alignment: figma.enum('alignment', {
'top-left': 'top-left',
'top-right': 'top-right',
Expand Down
1 change: 1 addition & 0 deletions packages/code-connect/Molecules/Coachmark.figma.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ figma.connect(
'https://www.figma.com/design/ReGfRNillGABAj5SlITalN/%F0%9F%93%90-Gamut?node-id=19366-27764',
{
props: {
// TODO: [GMT-1297] Update these 'left' / 'right' values to 'start' / 'end' after the Figma changes take effect.
beak: figma.enum('beak', {
right: 'right',
left: 'left',
Expand Down
1 change: 1 addition & 0 deletions packages/code-connect/Molecules/Disclosure.figma.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ figma.connect(
}),
}),
buttonInfo: figma.nestedProps('.cta', {
// TODO: [GMT-1297] Update these 'left' / 'right' values to 'start' / 'end' after the Figma changes take effect.
buttonPlacement: figma.enum('buttonPlacement', {
left: 'left',
right: 'right',
Expand Down
1 change: 1 addition & 0 deletions packages/code-connect/Molecules/Flyout.figma.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ figma.connect(
'https://www.figma.com/design/ReGfRNillGABAj5SlITalN/%F0%9F%93%90-Gamut?node-id=6329%3A5647',
{
props: {
// TODO: [GMT-1297] Update these 'left' / 'right' values to 'start' / 'end' after the Figma changes take effect.
openFrom: figma.enum('openFrom', {
left: 'left',
right: 'right',
Expand Down
1 change: 1 addition & 0 deletions packages/code-connect/Molecules/Popover.figma.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ figma.connect(
'center-left': 'center',
}),
}),
// TODO: [GMT-1297] Update these 'left' / 'right' values to 'start' / 'end' after the Figma changes take effect.
align: figma.boolean('beak', {
true: figma.enum('beakPosition', {
left: 'left',
Expand Down
1 change: 1 addition & 0 deletions packages/code-connect/Molecules/Tips/InfoTip.figma.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ figma.connect(
high: 'high',
}),
toolTipInfo: figma.nestedProps('.infotip-alignment', {
// TODO: [GMT-1297] Update these alignment values to their 'start' / 'end' equivalents after the Figma changes take effect.
alignment: figma.enum('alignment', {
'top-left': 'top-left',
'top-right': 'top-right',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ figma.connect(
{
props: {
previewTipProps: figma.nestedProps('.previewtip-alignment-anchor', {
// TODO: [GMT-1297] Update these alignment values to their 'start' / 'end' equivalents after the Figma changes take effect.
alignment: figma.enum('alignment', {
'bottom-left': 'bottom-left',
'bottom-right': 'bottom-right',
Expand Down
1 change: 1 addition & 0 deletions packages/code-connect/Molecules/Tips/ToolTip.figma.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ figma.connect(
'https://www.figma.com/design/ReGfRNillGABAj5SlITalN/%F0%9F%93%90-Gamut?node-id=41215%3A28041',
{
props: {
// TODO: [GMT-1297] Update these alignment values to their 'start' / 'end' equivalents after the Figma changes take effect.
alignment: figma.enum('alignment', {
'bottom-center': 'bottom-center',
'left-center': 'left-center',
Expand Down
3 changes: 3 additions & 0 deletions packages/code-connect/Organisms/GridForm.figma.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ figma.connect(
Sections: [
{
title: 'Section Header',
// TODO: [GMT-1297] Update this 'left' value to 'start' after the Figma changes take effect.
layout: 'left',
variant: 'title-md',
fields: [
Expand All @@ -85,6 +86,7 @@ figma.connect(
},
{
title: 'Section Header',
// TODO: [GMT-1297] Update this 'left' value to 'start' after the Figma changes take effect.
layout: 'left',
variant: 'title-md',
fields: [
Expand All @@ -108,6 +110,7 @@ figma.connect(
},
],
}),
// TODO: [GMT-1297] Update these 'left' / 'right' position values to 'start' / 'end' after the Figma changes take effect.
submit: figma.enum('Template', {
Starter: {
contents: 'Submit form',
Expand Down
2 changes: 1 addition & 1 deletion packages/gamut-agent-tools/skills/gamut-buttons/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Shared by `FillButton`, `StrokeButton`, `TextButton`, and `IconButton`. `CTAButt
| `variant` | `"primary" \| "secondary" \| "danger" \| "interface"` | Color emphasis (see table above) |
| `size` | `"small" \| "normal" \| "large"` | Padding and font size |
| `icon` | Icon component | Leading or trailing icon (Fill, Stroke, Text) |
| `iconPosition` | `"left" \| "right"` | Defaults to left |
| `iconPosition` | `"start" \| "end"` | Defaults to start |
| `disabled` | boolean | Disabled state styling |
| `href` | string | Renders as `<a>` tag |
| `tip` | string | Required on `IconButton` (tooltip + hover label) |
Expand Down
8 changes: 4 additions & 4 deletions packages/gamut-agent-tools/skills/gamut-datatable/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ import { useLocalQuery } from '@skillsoft/gamut';
| `type` | `'content' \| 'header' \| 'control' \| 'select' \| 'expand' \| 'expandControl' \| 'orderedHeader' \| 'tableControl'` | `ListColProps['type']`; `'content'` is default — see [Column `type`](#column-type) |
| `size` | `'content' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | `'content'` (default) fits cell contents; use `sm`–`xl` for fixed column widths |
| `fill` | `boolean` | Expands the column to fill remaining width |
| `justify` | `'left' \| 'right'` | Cell alignment |
| `justify` | `'start' \| 'end'` | Cell alignment |
| `sortable` | `boolean` | Adds a sort toggle to the column header |
| `filters` | `string[]` | Adds a filter dropdown with these string values |
| `options` | `Array<string \| { text: string; value: string }>` | Alternative to `filters` when display text differs from value |
Expand Down Expand Up @@ -115,7 +115,7 @@ const columns = [
header: 'Score',
size: 'sm',
sortable: true,
justify: 'right',
justify: 'end',
},
];

Expand Down Expand Up @@ -178,7 +178,7 @@ const RowActions = ({ rowId }) => {
onClick={() => setIsOpen(!isOpen)}
/>
<PopoverContainer
alignment="bottom-left"
alignment="bottom-start"
allowPageInteraction
closeOnViewportExit
isOpen={isOpen}
Expand Down Expand Up @@ -217,7 +217,7 @@ const columns = [
header: '',
size: 'sm',
type: 'control',
justify: 'right',
justify: 'end',
render: (row) => <RowActions rowId={row.id} />,
},
];
Expand Down
6 changes: 3 additions & 3 deletions packages/gamut-agent-tools/skills/gamut-menu/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ When `icon` is provided and `children` is omitted, `label` is required.
// correct — custom tooltip alignment
<MenuItem
icon={PeopleIcon}
label={{ info: 'Manage team', alignment: 'right-center' }}
label={{ info: 'Manage team', alignment: 'end-center' }}
href="/team"
/>

Expand All @@ -138,7 +138,7 @@ Pass `label` on a `disabled` `MenuItem` to explain why it is unavailable.
```tsx
<MenuItem
disabled
label={{ info: 'Requires admin access', alignment: 'right-center' }}
label={{ info: 'Requires admin access', alignment: 'end-center' }}
onClick={handleAction}
>
Admin action
Expand All @@ -151,7 +151,7 @@ Offset the `PopoverContainer` y-axis by `48` (normal spacing) or `32` (condensed

```tsx
<PopoverContainer
alignment="top-right"
alignment="top-end"
inline
isOpen={isOpen}
targetRef={triggerRef}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ The table below shows the keys and value types for an option object:
| `disabled` | `boolean` | no | Option cannot be selected |
| `subtitle` | `string` | no | Secondary text below the label |
| `rightLabel` | `string` | no | Text on the right side of the option |
| `icon` | icon component from `gamut-icons` | no | A `@skillsoft/gamut-icons` component |
| `icon` | icon component from `gamut-icons` | no | A `@skillsoft/gamut-icons` component |
| `abbreviation` | `string` | no | Short text shown in the input while the full label shows in the menu |

Grouped options: `{ label, options: [...], divider? }` (extends react-select `GroupBase`; `divider` draws a rule above the group).
Expand Down Expand Up @@ -172,7 +172,7 @@ const lastInput = useRef('');
| `shownOptionsLimit` | `1`–`6` | `6` | Visible options before the menu scrolls |
| `inputWidth` | `string \| number` | — | Width of the input independent of the menu |
| `dropdownWidth` | `string \| number` | — | Width of the menu independent of the input |
| `menuAlignment` | `'left' \| 'right'` | `left` | Menu edge alignment |
| `menuAlignment` | `'start' \| 'end'` | `start` | Menu edge alignment |
| `zIndex` | `number` | `2` | Menu z-index (control container defaults to `3`) |
| `inputProps` | `{ hidden?, combobox? }` | — | `data-*` / `aria-*` only, forwarded to the input elements |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ Pass a `ReactNode` to `label` when the label needs its own markup or styling —

### Label side

<StoryEmbed id="atoms-toggle--label-left" height="6rem" />
<StoryEmbed id="atoms-toggle--label-right" height="6rem" />
<StoryEmbed id="atoms-toggle--label-start" height="6rem" />
<StoryEmbed id="atoms-toggle--label-end" height="6rem" />

### Disabled

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Use a `Disclosure` to progressively reveal information, letting a reader access

### Adding a call-to-action button

Pass `ctaText` and `ctaCallback` together to render a button at the bottom of the body — both are required for it to appear. `buttonType` (`'FillButton' | 'StrokeButton' | 'TextButton'`, default `'TextButton'`) picks which button component renders it, and `buttonPlacement` (`'left' | 'right'`, default `'right'`) picks its alignment:
Pass `ctaText` and `ctaCallback` together to render a button at the bottom of the body — both are required for it to appear. `buttonType` (`'FillButton' | 'StrokeButton' | 'TextButton'`, default `'TextButton'`) picks which button component renders it, and `buttonPlacement` (`'start' | 'end'`, default `'end'`) picks its alignment:

```tsx
<Disclosure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import StoryEmbed from '~/components/StoryEmbed.astro';

### Anatomy

`Drawer` is two nested pieces: an outer container that animates its own width, and an inner content box pinned to whichever edge `alignContentContainer` names (`'left'` or `'right'`, default `'right'`) — the content keeps its full target width throughout the animation, revealed as the outer container's width grows:
`Drawer` is two nested pieces: an outer container that animates its own width, and an inner content box pinned to whichever edge `alignContentContainer` names (`'start'` or `'end'`, default `'end'`) — the content keeps its full target width throughout the animation, revealed as the outer container's width grows:

<FigmaEmbed url="https://www.figma.com/design/ReGfRNillGABAj5SlITalN/%F0%9F%93%90-Gamut?node-id=30420-41014&node-type=frame" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ Pass `fill` on one or more columns in a row to have them grow and consume whatev
height="8rem"
/>

### Right-aligning content
### End-aligning content

Pass `justify="right"`. Avoid mixing left- and right-justified columns within the same list — it makes scanning harder:
Pass `justify="end"`. Avoid mixing start- and end-justified columns within the same list — it makes scanning harder:

<StoryEmbed
id="organisms-lists-tables-list-listcol--justification"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ Inline tips accept `zIndex` to control stacking against surrounding content that

## Prop Reference

Alignment is a shared concept — a tip positions itself relative to whatever triggers it — but the exact values differ by component: `ToolTip` aligns to a side (`top-center`, `bottom-center`, `left-center`, `right-center`), while `InfoTip` and `PreviewTip` align to a corner (`top-left`, `top-right`, `bottom-left`, `bottom-right`). See each component's own Prop Reference section for its alignment story, and [ToolTip's horizontal alignment story](https://gamut.codecademy.com/?path=/story/molecules-tips-tooltip--horizontal-alignments) for how alignment adapts under RTL layouts.
Alignment is a shared concept — a tip positions itself relative to whatever triggers it — but the exact values differ by component: `ToolTip` aligns to a side (`top-center`, `bottom-center`, `start-center`, `end-center`), while `InfoTip` and `PreviewTip` align to a corner (`top-start`, `top-end`, `bottom-start`, `bottom-end`). See each component's own Prop Reference section for its alignment story, and [ToolTip's horizontal alignment story](https://gamut.codecademy.com/?path=/story/molecules-tips-tooltip--horizontal-alignments) for how alignment adapts under RTL layouts.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Use `ariaLabelledby` to point at visible text that already names the info icon's

### Alignment

`alignment` accepts `top-left`, `top-right` (default), `bottom-left`, or `bottom-right`:
`alignment` accepts `top-start`, `top-end` (default), `bottom-start`, or `bottom-end`:

<StoryEmbed id="molecules-tips-infotip--alignments" height="16rem" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ Pass `loading` while the preview content is still being fetched:

## Playground

`alignment` accepts `top-left`, `top-right` (default), `bottom-left`, or `bottom-right`, the same corner set as `InfoTip`:
`alignment` accepts `top-start`, `top-end` (default), `bottom-start`, or `bottom-end`, the same corner set as `InfoTip`:

<StoryEmbed id="molecules-tips-previewtip--default" height="10rem" />
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ Wrap `ToolTip` directly around any interactive element, not just `IconButton`, w

### Alignment

`alignment` accepts `top-center` (default), `bottom-center`, `left-center`, or `right-center`:
`alignment` accepts `top-center` (default), `bottom-center`, `start-center`, or `end-center`:

<StoryEmbed id="molecules-tips-tooltip--alignments" height="16rem" />

Under RTL layouts, `left-center`/`right-center` mirror to follow reading direction:
Under RTL layouts, `start-center`/`end-center` mirror to follow reading direction:

<StoryEmbed id="molecules-tips-tooltip--horizontal-alignments" height="16rem" />
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Use a field's `size` and `rowspan` (borrowed from [LayoutGrid](/components/conta

## Building sections

Pass section objects (each with a `title` and its own `fields`) alongside loose fields in the `fields` array. A section's `layout` can be `"left"` (title takes 3 columns) or centered (the default); `as` sets the title's heading level (default `h2`) and must be a heading tag:
Pass section objects (each with a `title` and its own `fields`) alongside loose fields in the `fields` array. A section's `layout` can be `"start"` (title takes 3 columns) or centered (the default); `as` sets the title's heading level (default `h2`) and must be a heading tag:

<StoryEmbed id="organisms-gridform-layout--sections" height="40rem" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ A honeypot field — named to avoid tipping off bots that it's a spam trap, unli

### Position

`submit.position` picks its alignment: `'left'` (default), `'center'`, `'right'`, or `'stretch'`.
`submit.position` picks its alignment: `'start'` (default), `'center'`, `'end'`, or `'stretch'`.

#### Left

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ Set `disabled` on an individual option to keep it visible but unselectable:

### Layout & positioning

`inputWidth`/`dropdownWidth` size the input and menu independently, and `menuAlignment="right"` aligns the menu to the input's right edge instead of its left.
`inputWidth`/`dropdownWidth` size the input and menu independently, and `menuAlignment="end"` aligns the menu to the input's end edge instead of its start.

#### Independent widths

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Use `Anchor` to navigate to another page, a resource, or a location on the same

### Adding icons

Pass `icon` and `iconPosition` (`'left' | 'right'`) to place an icon relative to the label:
Pass `icon` and `iconPosition` (`'start' | 'end'`) to place an icon relative to the label:

<StoryEmbed id="typography-anchor--icon-anchor" height="6rem" />

Expand Down
Loading
Loading