@arbor-education/design-system.components 1.0.5 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/components/breadcrumbs/BreadcrumbCopyButton.d.ts.map +1 -1
- package/dist/components/breadcrumbs/BreadcrumbCopyButton.js +3 -2
- package/dist/components/breadcrumbs/BreadcrumbCopyButton.js.map +1 -1
- package/dist/components/breadcrumbs/BreadcrumbEllipsis.d.ts.map +1 -1
- package/dist/components/breadcrumbs/BreadcrumbEllipsis.js +2 -1
- package/dist/components/breadcrumbs/BreadcrumbEllipsis.js.map +1 -1
- package/dist/components/button/Button.d.ts +17 -8
- package/dist/components/button/Button.d.ts.map +1 -1
- package/dist/components/button/Button.js +5 -6
- package/dist/components/button/Button.js.map +1 -1
- package/dist/components/button/Button.stories.d.ts +17 -36
- package/dist/components/button/Button.stories.d.ts.map +1 -1
- package/dist/components/button/Button.stories.js +165 -214
- package/dist/components/button/Button.stories.js.map +1 -1
- package/dist/components/button/Button.test.d.ts.map +1 -1
- package/dist/components/button/Button.test.js +16 -10
- package/dist/components/button/Button.test.js.map +1 -1
- package/dist/components/datePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/datePicker/DatePicker.js +2 -1
- package/dist/components/datePicker/DatePicker.js.map +1 -1
- package/dist/components/dateTimePicker/DateTimePicker.d.ts.map +1 -1
- package/dist/components/dateTimePicker/DateTimePicker.js +2 -1
- package/dist/components/dateTimePicker/DateTimePicker.js.map +1 -1
- package/dist/components/dropdown/Dropdown.stories.d.ts.map +1 -1
- package/dist/components/dropdown/Dropdown.stories.js +5 -3
- package/dist/components/dropdown/Dropdown.stories.js.map +1 -1
- package/dist/components/emptyState/EmptyState.stories.d.ts.map +1 -1
- package/dist/components/emptyState/EmptyState.stories.js +3 -2
- package/dist/components/emptyState/EmptyState.stories.js.map +1 -1
- package/dist/components/fileUpload/FileUpload.d.ts.map +1 -1
- package/dist/components/fileUpload/FileUpload.js +1 -1
- package/dist/components/fileUpload/FileUpload.js.map +1 -1
- package/dist/components/fileUpload/FileUpload.test.js +4 -4
- package/dist/components/fileUpload/FileUpload.test.js.map +1 -1
- package/dist/components/formField/inputs/colourPickerDropdown/ColourPickerDropdown.d.ts.map +1 -1
- package/dist/components/formField/inputs/colourPickerDropdown/ColourPickerDropdown.js +2 -1
- package/dist/components/formField/inputs/colourPickerDropdown/ColourPickerDropdown.js.map +1 -1
- package/dist/components/formField/inputs/selectDropdown/SelectDropdown.d.ts.map +1 -1
- package/dist/components/formField/inputs/selectDropdown/SelectDropdown.js +2 -1
- package/dist/components/formField/inputs/selectDropdown/SelectDropdown.js.map +1 -1
- package/dist/components/grid/Grid.stories.d.ts.map +1 -1
- package/dist/components/grid/Grid.stories.js +4 -3
- package/dist/components/grid/Grid.stories.js.map +1 -1
- package/dist/components/heading/Heading.stories.d.ts.map +1 -1
- package/dist/components/heading/Heading.stories.js +18 -14
- package/dist/components/heading/Heading.stories.js.map +1 -1
- package/dist/components/icon/Icon.stories.d.ts.map +1 -1
- package/dist/components/icon/Icon.stories.js +30 -31
- package/dist/components/icon/Icon.stories.js.map +1 -1
- package/dist/components/modal/ModalCloseButton.d.ts.map +1 -1
- package/dist/components/modal/ModalCloseButton.js +2 -1
- package/dist/components/modal/ModalCloseButton.js.map +1 -1
- package/dist/components/section/Section.stories.d.ts.map +1 -1
- package/dist/components/section/Section.stories.js +52 -25
- package/dist/components/section/Section.stories.js.map +1 -1
- package/dist/components/table/Table.stories.d.ts.map +1 -1
- package/dist/components/table/Table.stories.js +4 -6
- package/dist/components/table/Table.stories.js.map +1 -1
- package/dist/components/table/pagination/PageSizeSelector.d.ts.map +1 -1
- package/dist/components/table/pagination/PageSizeSelector.js +2 -1
- package/dist/components/table/pagination/PageSizeSelector.js.map +1 -1
- package/dist/components/table/pagination/PaginationControls.d.ts.map +1 -1
- package/dist/components/table/pagination/PaginationControls.js +3 -2
- package/dist/components/table/pagination/PaginationControls.js.map +1 -1
- package/dist/components/table/tableControls/BulkActionsDropdown.d.ts.map +1 -1
- package/dist/components/table/tableControls/BulkActionsDropdown.js +3 -2
- package/dist/components/table/tableControls/BulkActionsDropdown.js.map +1 -1
- package/dist/components/table/tableControls/TableControls.d.ts.map +1 -1
- package/dist/components/table/tableControls/TableControls.js +2 -1
- package/dist/components/table/tableControls/TableControls.js.map +1 -1
- package/dist/components/table/tableControls/TableSettingsDropdown.d.ts.map +1 -1
- package/dist/components/table/tableControls/TableSettingsDropdown.js +2 -1
- package/dist/components/table/tableControls/TableSettingsDropdown.js.map +1 -1
- package/dist/components/toast/Toast.js +1 -1
- package/dist/components/toast/Toast.js.map +1 -1
- package/dist/components/tooltip/Tooltip.stories.js +5 -5
- package/dist/components/tooltip/Tooltip.stories.js.map +1 -1
- package/dist/components/tooltip/TooltipWrapper.stories.js +2 -2
- package/dist/components/tooltip/TooltipWrapper.stories.js.map +1 -1
- package/dist/components/userDropdown/internal/UserDropdownTrigger.d.ts.map +1 -1
- package/dist/components/userDropdown/internal/UserDropdownTrigger.js +3 -2
- package/dist/components/userDropdown/internal/UserDropdownTrigger.js.map +1 -1
- package/dist/index.css +16 -16
- package/dist/index.css.map +1 -1
- package/package.json +1 -1
- package/src/components/breadcrumbs/BreadcrumbCopyButton.tsx +5 -2
- package/src/components/breadcrumbs/BreadcrumbEllipsis.tsx +5 -2
- package/src/components/breadcrumbs/breadcrumbs.scss +2 -2
- package/src/components/button/Button.stories.tsx +205 -230
- package/src/components/button/Button.test.tsx +36 -9
- package/src/components/button/Button.tsx +6 -16
- package/src/components/button/button.scss +8 -8
- package/src/components/combobox/combobox.scss +1 -1
- package/src/components/datePicker/DatePicker.tsx +5 -3
- package/src/components/dateTimePicker/DateTimePicker.tsx +5 -3
- package/src/components/dropdown/Dropdown.stories.tsx +7 -3
- package/src/components/emptyState/EmptyState.stories.tsx +4 -2
- package/src/components/fileUpload/FileUpload.test.tsx +4 -4
- package/src/components/fileUpload/FileUpload.tsx +8 -4
- package/src/components/formField/inputs/colourPickerDropdown/ColourPickerDropdown.tsx +3 -1
- package/src/components/formField/inputs/selectDropdown/SelectDropdown.tsx +3 -2
- package/src/components/grid/Grid.stories.tsx +17 -4
- package/src/components/heading/Heading.stories.tsx +23 -16
- package/src/components/icon/Icon.stories.tsx +43 -44
- package/src/components/modal/ModalCloseButton.tsx +5 -3
- package/src/components/section/Section.stories.tsx +86 -31
- package/src/components/table/Table.stories.tsx +19 -6
- package/src/components/table/pagination/PageSizeSelector.tsx +3 -1
- package/src/components/table/pagination/PaginationControls.tsx +17 -12
- package/src/components/table/tableControls/BulkActionsDropdown.tsx +3 -1
- package/src/components/table/tableControls/TableControls.tsx +31 -22
- package/src/components/table/tableControls/TableSettingsDropdown.tsx +7 -4
- package/src/components/toast/Toast.tsx +1 -1
- package/src/components/tooltip/Tooltip.stories.tsx +7 -7
- package/src/components/tooltip/TooltipWrapper.stories.tsx +4 -4
- package/src/components/userDropdown/internal/UserDropdownTrigger.tsx +2 -1
|
@@ -624,7 +624,8 @@ const DecorativeVsMeaningfulTemplate = () => (
|
|
|
624
624
|
Decorative — icon accompanies visible button text. No screenReaderText needed.
|
|
625
625
|
Screen reader announces "Edit" from the button text.
|
|
626
626
|
</p>
|
|
627
|
-
<Button variant="secondary" type="button"
|
|
627
|
+
<Button variant="secondary" type="button">
|
|
628
|
+
<Icon name="pencil" />
|
|
628
629
|
Edit
|
|
629
630
|
</Button>
|
|
630
631
|
<p className="ds-text" style={{ margin: 0, color: 'var(--color-grey-600)', fontStyle: 'italic' }}>
|
|
@@ -639,15 +640,16 @@ const DecorativeVsMeaningfulTemplate = () => (
|
|
|
639
640
|
}}
|
|
640
641
|
>
|
|
641
642
|
<p className="ds-text" style={{ margin: 0, color: 'var(--color-grey-600)' }}>
|
|
642
|
-
Meaningful — icon-only button. Accessible name via
|
|
643
|
-
|
|
643
|
+
Meaningful — icon-only button. Accessible name via screenReaderText on the Icon,
|
|
644
|
+
since Button no longer supplies a fallback.
|
|
644
645
|
</p>
|
|
645
646
|
<Button
|
|
646
647
|
variant="tertiary"
|
|
647
648
|
type="button"
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
649
|
+
isRound
|
|
650
|
+
>
|
|
651
|
+
<Icon name="pencil" screenReaderText="Edit student record" />
|
|
652
|
+
</Button>
|
|
651
653
|
<p className="ds-text" style={{ margin: 0, color: 'var(--color-grey-600)', fontStyle: 'italic' }}>
|
|
652
654
|
Screen reader: "Edit student record, button"
|
|
653
655
|
</p>
|
|
@@ -892,30 +894,28 @@ const InButtonContextTemplate = () => (
|
|
|
892
894
|
}}
|
|
893
895
|
>
|
|
894
896
|
<p className="ds-text" style={{ margin: 0, color: 'var(--color-grey-600)' }}>
|
|
895
|
-
Button
|
|
896
|
-
{' '}
|
|
897
|
-
{'<Icon>'}
|
|
898
|
-
{' '}
|
|
899
|
-
as a child
|
|
897
|
+
Button renders Icon as a plain child — there are no separate icon-name props.
|
|
900
898
|
</p>
|
|
901
899
|
<div style={{ display: 'flex', gap: 'var(--spacing-large)', flexWrap: 'wrap', alignItems: 'center' }}>
|
|
902
|
-
<Button variant="primary" type="button"
|
|
900
|
+
<Button variant="primary" type="button">
|
|
901
|
+
<Icon name="plus" />
|
|
903
902
|
Add student
|
|
904
903
|
</Button>
|
|
905
904
|
<Button
|
|
906
905
|
variant="secondary"
|
|
907
906
|
type="button"
|
|
908
|
-
iconRightName="chevron-down"
|
|
909
907
|
>
|
|
910
908
|
Select year group
|
|
909
|
+
<Icon name="chevron-down" />
|
|
911
910
|
</Button>
|
|
912
911
|
{/* Icon-only tertiary — in production, wrap in TooltipWrapper for hover/focus affordance */}
|
|
913
912
|
<Button
|
|
914
913
|
variant="tertiary"
|
|
915
914
|
type="button"
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
915
|
+
isRound
|
|
916
|
+
>
|
|
917
|
+
<Icon name="3-dot" screenReaderText="More actions" />
|
|
918
|
+
</Button>
|
|
919
919
|
</div>
|
|
920
920
|
<p className="ds-text" style={{ margin: 0, color: 'var(--color-grey-600)', fontStyle: 'italic' }}>
|
|
921
921
|
The icon-only tertiary button above should be wrapped in a TooltipWrapper in production
|
|
@@ -1215,22 +1215,20 @@ export const DecorativeVsMeaningful: Story = withDescription(
|
|
|
1215
1215
|
source: {
|
|
1216
1216
|
language: 'tsx',
|
|
1217
1217
|
code: `
|
|
1218
|
-
import { Button } from '@arbor-education/design-system.components';
|
|
1218
|
+
import { Button, Icon } from '@arbor-education/design-system.components';
|
|
1219
1219
|
|
|
1220
1220
|
function DecorativeVsMeaningfulExample() {
|
|
1221
1221
|
return (
|
|
1222
1222
|
<div style={{ display: 'flex', flexDirection: 'column', gap: 'var(--spacing-xlarge)', padding: 'var(--spacing-xlarge)' }}>
|
|
1223
1223
|
{/* Decorative — icon accompanies visible button text. Screen reader: "Edit, button" */}
|
|
1224
|
-
<Button variant="secondary" type="button"
|
|
1224
|
+
<Button variant="secondary" type="button">
|
|
1225
|
+
<Icon name="pencil" />
|
|
1225
1226
|
Edit
|
|
1226
1227
|
</Button>
|
|
1227
|
-
{/* Meaningful — icon-only button.
|
|
1228
|
-
<Button
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
iconRightName="pencil"
|
|
1232
|
-
iconRightScreenReaderText="Edit student record"
|
|
1233
|
-
/>
|
|
1228
|
+
{/* Meaningful — icon-only button. screenReaderText on the Icon provides the accessible name. */}
|
|
1229
|
+
<Button variant="tertiary" type="button" isRound>
|
|
1230
|
+
<Icon name="pencil" screenReaderText="Edit student record" />
|
|
1231
|
+
</Button>
|
|
1234
1232
|
</div>
|
|
1235
1233
|
);
|
|
1236
1234
|
}
|
|
@@ -1247,9 +1245,9 @@ export default DecorativeVsMeaningfulExample;
|
|
|
1247
1245
|
'No `screenReaderText` on the Icon. The button\'s accessible name is "Edit" — from the visible text.',
|
|
1248
1246
|
'Adding SR text here would cause "Edit pencil" duplication.',
|
|
1249
1247
|
'',
|
|
1250
|
-
'**Meaningful (bottom):** an icon-only button with no visible text.',
|
|
1251
|
-
'`
|
|
1252
|
-
'
|
|
1248
|
+
'**Meaningful (bottom):** an icon-only button (`isRound`) with no visible text.',
|
|
1249
|
+
'`screenReaderText="Edit student record"` on the `Icon` provides the button\'s only accessible name —',
|
|
1250
|
+
'unlike before, Button will not fall back to the icon name for you.',
|
|
1253
1251
|
'',
|
|
1254
1252
|
'The rule is: **one accessible name per interactive element**. Choose where to put it, but never',
|
|
1255
1253
|
'duplicate it. For icon-only buttons in production, also add a TooltipWrapper for sighted mouse users.',
|
|
@@ -1318,24 +1316,23 @@ export const InButtonContext: Story = withDescription(
|
|
|
1318
1316
|
source: {
|
|
1319
1317
|
language: 'tsx',
|
|
1320
1318
|
code: `
|
|
1321
|
-
import { Button } from '@arbor-education/design-system.components';
|
|
1319
|
+
import { Button, Icon } from '@arbor-education/design-system.components';
|
|
1322
1320
|
|
|
1323
1321
|
function InButtonContextExample() {
|
|
1324
1322
|
return (
|
|
1325
1323
|
<div style={{ display: 'flex', gap: 'var(--spacing-large)', flexWrap: 'wrap', alignItems: 'center' }}>
|
|
1326
|
-
<Button variant="primary" type="button"
|
|
1324
|
+
<Button variant="primary" type="button">
|
|
1325
|
+
<Icon name="plus" />
|
|
1327
1326
|
Add student
|
|
1328
1327
|
</Button>
|
|
1329
|
-
<Button variant="secondary" type="button"
|
|
1328
|
+
<Button variant="secondary" type="button">
|
|
1330
1329
|
Select year group
|
|
1330
|
+
<Icon name="chevron-down" />
|
|
1331
1331
|
</Button>
|
|
1332
1332
|
{/* Icon-only — wrap in TooltipWrapper in production for hover/focus affordance */}
|
|
1333
|
-
<Button
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
iconRightName="3-dot"
|
|
1337
|
-
iconRightScreenReaderText="More actions"
|
|
1338
|
-
/>
|
|
1333
|
+
<Button variant="tertiary" type="button" isRound>
|
|
1334
|
+
<Icon name="3-dot" screenReaderText="More actions" />
|
|
1335
|
+
</Button>
|
|
1339
1336
|
</div>
|
|
1340
1337
|
);
|
|
1341
1338
|
}
|
|
@@ -1348,16 +1345,18 @@ export default InButtonContextExample;
|
|
|
1348
1345
|
[
|
|
1349
1346
|
'How Icon appears in real Button usage.',
|
|
1350
1347
|
'',
|
|
1351
|
-
'
|
|
1352
|
-
'
|
|
1348
|
+
'`Button` renders `children` as-is — render an `Icon` before and/or after the label text yourself.',
|
|
1349
|
+
'There are no separate icon-name props on `Button`.',
|
|
1353
1350
|
'',
|
|
1354
|
-
'
|
|
1351
|
+
'A leading `<Icon name="plus" />` before the label is the default icon+label pattern for action buttons.',
|
|
1355
1352
|
'',
|
|
1356
|
-
'
|
|
1353
|
+
'A trailing `<Icon name="chevron-down" />` after the label is a trailing action-indicator',
|
|
1354
|
+
'(communicates "opens a menu"). Both are decorative here since the label already conveys the action,',
|
|
1355
|
+
'so neither Icon needs `screenReaderText`.',
|
|
1357
1356
|
'',
|
|
1358
|
-
'Icon-only tertiary
|
|
1359
|
-
'be wrapped in a `TooltipWrapper` to provide a hover/focus label for
|
|
1360
|
-
'guidance on icon-only interactive elements.',
|
|
1357
|
+
'Icon-only tertiary: `isRound` on the `Button` plus `screenReaderText="More actions"` on the `Icon` —',
|
|
1358
|
+
'in production, this should also be wrapped in a `TooltipWrapper` to provide a hover/focus label for',
|
|
1359
|
+
'sighted users per Confluence guidance on icon-only interactive elements.',
|
|
1361
1360
|
].join(' '),
|
|
1362
1361
|
);
|
|
1363
1362
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useContext, useEffect } from 'react';
|
|
2
2
|
import { ModalContext } from './Modal.js';
|
|
3
3
|
import { Button, type ButtonProps } from 'Components/button/Button';
|
|
4
|
+
import { Icon } from 'Components/icon/Icon';
|
|
4
5
|
import classNames from 'classnames';
|
|
5
6
|
|
|
6
7
|
export const ModalCloseButon = (props: ButtonProps) => {
|
|
@@ -29,11 +30,12 @@ export const ModalCloseButon = (props: ButtonProps) => {
|
|
|
29
30
|
size="S"
|
|
30
31
|
onClick={closeHandler}
|
|
31
32
|
variant="secondary"
|
|
32
|
-
|
|
33
|
-
iconRightScreenReaderText="Close"
|
|
33
|
+
isRound
|
|
34
34
|
borderless
|
|
35
35
|
className={classNames('ds-modal__close-button', className)}
|
|
36
36
|
{...rest}
|
|
37
|
-
|
|
37
|
+
>
|
|
38
|
+
<Icon name="x" screenReaderText="Close" />
|
|
39
|
+
</Button>
|
|
38
40
|
);
|
|
39
41
|
};
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
import { fn } from 'storybook/test';
|
|
12
12
|
|
|
13
13
|
import { Row } from 'Components/row/Row';
|
|
14
|
+
import { Icon } from 'Components/icon/Icon';
|
|
14
15
|
import { Section } from './Section.js';
|
|
15
16
|
|
|
16
17
|
// ---------------------------------------------------------------------------
|
|
@@ -409,7 +410,7 @@ export const WithActionButton: Story = withDescription(
|
|
|
409
410
|
source: {
|
|
410
411
|
language: 'tsx',
|
|
411
412
|
code: `
|
|
412
|
-
import { Section } from '@arbor-education/design-system.components';
|
|
413
|
+
import { Section, Icon } from '@arbor-education/design-system.components';
|
|
413
414
|
|
|
414
415
|
function PersonalDetailsSection() {
|
|
415
416
|
return (
|
|
@@ -417,8 +418,12 @@ function PersonalDetailsSection() {
|
|
|
417
418
|
title="Personal Details"
|
|
418
419
|
headingLevel={2}
|
|
419
420
|
headerButtonProps={{
|
|
420
|
-
children:
|
|
421
|
-
|
|
421
|
+
children: (
|
|
422
|
+
<>
|
|
423
|
+
<Icon name="pencil" />
|
|
424
|
+
Edit
|
|
425
|
+
</>
|
|
426
|
+
),
|
|
422
427
|
onClick: () => openEditModal(),
|
|
423
428
|
variant: 'secondary',
|
|
424
429
|
size: 'S',
|
|
@@ -438,21 +443,25 @@ export default PersonalDetailsSection;
|
|
|
438
443
|
title="Personal Details"
|
|
439
444
|
headingLevel={2}
|
|
440
445
|
headerButtonProps={{
|
|
441
|
-
children:
|
|
442
|
-
|
|
446
|
+
children: (
|
|
447
|
+
<>
|
|
448
|
+
<Icon name="pencil" />
|
|
449
|
+
Edit
|
|
450
|
+
</>
|
|
451
|
+
),
|
|
443
452
|
onClick: fn(),
|
|
444
453
|
variant: 'secondary',
|
|
445
454
|
size: 'S',
|
|
446
455
|
}}
|
|
447
456
|
>
|
|
448
457
|
<p>
|
|
449
|
-
The action button appears in the heading row.
|
|
450
|
-
<code>
|
|
458
|
+
The action button appears in the heading row. Render an
|
|
459
|
+
<code>Icon</code>
|
|
451
460
|
{' '}
|
|
452
|
-
|
|
453
|
-
<code>
|
|
461
|
+
as part of the
|
|
462
|
+
<code>children</code>
|
|
454
463
|
{' '}
|
|
455
|
-
|
|
464
|
+
passed to
|
|
456
465
|
<code>headerButtonProps</code>
|
|
457
466
|
{' '}
|
|
458
467
|
to add an icon alongside the label.
|
|
@@ -460,7 +469,7 @@ export default PersonalDetailsSection;
|
|
|
460
469
|
</Section>
|
|
461
470
|
),
|
|
462
471
|
},
|
|
463
|
-
'Pass `headerButtonProps` to render an action button in the section heading. Icons
|
|
472
|
+
'Pass `headerButtonProps` to render an action button in the section heading. Icons are added by rendering an `Icon` inside `headerButtonProps.children`, before or after the label text. Use `size: "S"` to keep it visually lightweight alongside the title.',
|
|
464
473
|
);
|
|
465
474
|
|
|
466
475
|
export const WithActionButtonVariants: Story = withDescription(
|
|
@@ -471,35 +480,62 @@ export const WithActionButtonVariants: Story = withDescription(
|
|
|
471
480
|
source: {
|
|
472
481
|
language: 'tsx',
|
|
473
482
|
code: `
|
|
474
|
-
import { Section } from '@arbor-education/design-system.components';
|
|
483
|
+
import { Section, Icon } from '@arbor-education/design-system.components';
|
|
475
484
|
|
|
476
485
|
// Icon on the left
|
|
477
486
|
<Section title="Documents" headingLevel={2}
|
|
478
|
-
headerButtonProps={{
|
|
487
|
+
headerButtonProps={{
|
|
488
|
+
children: <><Icon name="upload" />Upload</>,
|
|
489
|
+
onClick: () => {},
|
|
490
|
+
variant: 'secondary',
|
|
491
|
+
size: 'S',
|
|
492
|
+
}}>
|
|
479
493
|
<p>...</p>
|
|
480
494
|
</Section>
|
|
481
495
|
|
|
482
496
|
// Icon on the right
|
|
483
497
|
<Section title="External Link" headingLevel={2}
|
|
484
|
-
headerButtonProps={{
|
|
498
|
+
headerButtonProps={{
|
|
499
|
+
children: <>Open<Icon name="external-link" /></>,
|
|
500
|
+
onClick: () => {},
|
|
501
|
+
variant: 'tertiary',
|
|
502
|
+
size: 'S',
|
|
503
|
+
}}>
|
|
485
504
|
<p>...</p>
|
|
486
505
|
</Section>
|
|
487
506
|
|
|
488
|
-
// Icon-only (no
|
|
507
|
+
// Icon-only (isRound + no label text — button renders in icon-only mode)
|
|
489
508
|
<Section title="Attachments" headingLevel={2}
|
|
490
|
-
headerButtonProps={{
|
|
509
|
+
headerButtonProps={{
|
|
510
|
+
isRound: true,
|
|
511
|
+
children: <Icon name="plus" screenReaderText="Add attachment" />,
|
|
512
|
+
onClick: () => {},
|
|
513
|
+
variant: 'secondary',
|
|
514
|
+
size: 'S',
|
|
515
|
+
}}>
|
|
491
516
|
<p>...</p>
|
|
492
517
|
</Section>
|
|
493
518
|
|
|
494
519
|
// Destructive
|
|
495
520
|
<Section title="Danger Zone" headingLevel={2}
|
|
496
|
-
headerButtonProps={{
|
|
521
|
+
headerButtonProps={{
|
|
522
|
+
children: <><Icon name="trash" />Delete</>,
|
|
523
|
+
onClick: () => {},
|
|
524
|
+
variant: 'primary-destructive',
|
|
525
|
+
size: 'S',
|
|
526
|
+
}}>
|
|
497
527
|
<p>...</p>
|
|
498
528
|
</Section>
|
|
499
529
|
|
|
500
530
|
// Disabled
|
|
501
531
|
<Section title="Locked Section" headingLevel={2}
|
|
502
|
-
headerButtonProps={{
|
|
532
|
+
headerButtonProps={{
|
|
533
|
+
children: <><Icon name="pencil" />Edit</>,
|
|
534
|
+
onClick: () => {},
|
|
535
|
+
variant: 'secondary',
|
|
536
|
+
size: 'S',
|
|
537
|
+
disabled: true,
|
|
538
|
+
}}>
|
|
503
539
|
<p>...</p>
|
|
504
540
|
</Section>
|
|
505
541
|
`.trim(),
|
|
@@ -512,8 +548,12 @@ import { Section } from '@arbor-education/design-system.components';
|
|
|
512
548
|
title="Documents"
|
|
513
549
|
headingLevel={2}
|
|
514
550
|
headerButtonProps={{
|
|
515
|
-
children:
|
|
516
|
-
|
|
551
|
+
children: (
|
|
552
|
+
<>
|
|
553
|
+
<Icon name="upload" />
|
|
554
|
+
Upload
|
|
555
|
+
</>
|
|
556
|
+
),
|
|
517
557
|
onClick: fn(),
|
|
518
558
|
variant: 'secondary',
|
|
519
559
|
size: 'S',
|
|
@@ -525,8 +565,12 @@ import { Section } from '@arbor-education/design-system.components';
|
|
|
525
565
|
title="External Link"
|
|
526
566
|
headingLevel={2}
|
|
527
567
|
headerButtonProps={{
|
|
528
|
-
children:
|
|
529
|
-
|
|
568
|
+
children: (
|
|
569
|
+
<>
|
|
570
|
+
Open
|
|
571
|
+
<Icon name="external-link" />
|
|
572
|
+
</>
|
|
573
|
+
),
|
|
530
574
|
onClick: fn(),
|
|
531
575
|
variant: 'tertiary',
|
|
532
576
|
size: 'S',
|
|
@@ -538,19 +582,22 @@ import { Section } from '@arbor-education/design-system.components';
|
|
|
538
582
|
title="Attachments"
|
|
539
583
|
headingLevel={2}
|
|
540
584
|
headerButtonProps={{
|
|
541
|
-
|
|
542
|
-
|
|
585
|
+
isRound: true,
|
|
586
|
+
children: <Icon name="plus" screenReaderText="Add attachment" />,
|
|
543
587
|
onClick: fn(),
|
|
544
588
|
variant: 'secondary',
|
|
545
589
|
size: 'S',
|
|
546
590
|
}}
|
|
547
591
|
>
|
|
548
592
|
<p>
|
|
549
|
-
Icon-only —
|
|
550
|
-
<code>
|
|
593
|
+
Icon-only — set
|
|
594
|
+
<code>isRound: true</code>
|
|
551
595
|
{' '}
|
|
552
596
|
and the button renders in compact icon-only mode. Always supply
|
|
553
|
-
<code>
|
|
597
|
+
<code>screenReaderText</code>
|
|
598
|
+
{' '}
|
|
599
|
+
on the child
|
|
600
|
+
<code>Icon</code>
|
|
554
601
|
{' '}
|
|
555
602
|
for accessibility.
|
|
556
603
|
</p>
|
|
@@ -559,8 +606,12 @@ import { Section } from '@arbor-education/design-system.components';
|
|
|
559
606
|
title="Danger Zone"
|
|
560
607
|
headingLevel={2}
|
|
561
608
|
headerButtonProps={{
|
|
562
|
-
children:
|
|
563
|
-
|
|
609
|
+
children: (
|
|
610
|
+
<>
|
|
611
|
+
<Icon name="trash" />
|
|
612
|
+
Delete
|
|
613
|
+
</>
|
|
614
|
+
),
|
|
564
615
|
onClick: fn(),
|
|
565
616
|
variant: 'primary-destructive',
|
|
566
617
|
size: 'S',
|
|
@@ -580,8 +631,12 @@ import { Section } from '@arbor-education/design-system.components';
|
|
|
580
631
|
title="Locked Section"
|
|
581
632
|
headingLevel={2}
|
|
582
633
|
headerButtonProps={{
|
|
583
|
-
children:
|
|
584
|
-
|
|
634
|
+
children: (
|
|
635
|
+
<>
|
|
636
|
+
<Icon name="pencil" />
|
|
637
|
+
Edit
|
|
638
|
+
</>
|
|
639
|
+
),
|
|
585
640
|
onClick: fn(),
|
|
586
641
|
variant: 'secondary',
|
|
587
642
|
size: 'S',
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
import { type Column, type ColDef, type ColGroupDef } from 'ag-grid-enterprise';
|
|
13
13
|
import { Table } from './Table.js';
|
|
14
14
|
import { Button } from 'Components/button/Button';
|
|
15
|
+
import { Icon } from 'Components/icon/Icon';
|
|
15
16
|
|
|
16
17
|
import { useState, type ComponentProps } from 'react';
|
|
17
18
|
import { RowCountInfo } from './pagination/RowCountInfo.js';
|
|
@@ -1115,8 +1116,12 @@ const sampleDataWithButtonCellRenderer = [
|
|
|
1115
1116
|
{
|
|
1116
1117
|
id: 5,
|
|
1117
1118
|
name: {
|
|
1118
|
-
children:
|
|
1119
|
-
|
|
1119
|
+
children: (
|
|
1120
|
+
<>
|
|
1121
|
+
<Icon name="download" />
|
|
1122
|
+
Ethan Hunt
|
|
1123
|
+
</>
|
|
1124
|
+
),
|
|
1120
1125
|
value: 'Ethan Hunt',
|
|
1121
1126
|
onClick: handleClick,
|
|
1122
1127
|
},
|
|
@@ -1215,8 +1220,12 @@ export const WithButtonCellRendererThatOpensAModalWithModalManager: StoryObj<Tab
|
|
|
1215
1220
|
{
|
|
1216
1221
|
id: 5,
|
|
1217
1222
|
name: {
|
|
1218
|
-
children:
|
|
1219
|
-
|
|
1223
|
+
children: (
|
|
1224
|
+
<>
|
|
1225
|
+
<Icon name="download" />
|
|
1226
|
+
Ethan Hunt
|
|
1227
|
+
</>
|
|
1228
|
+
),
|
|
1220
1229
|
value: 'Ethan Hunt',
|
|
1221
1230
|
onClick: () =>
|
|
1222
1231
|
ModalUtils.addModal({ children: ModalContent('Ethan Hunt') }),
|
|
@@ -1315,8 +1324,12 @@ export const WithButtonCellRendererThatOpensAModalWithComposableModal: StoryObj<
|
|
|
1315
1324
|
{
|
|
1316
1325
|
id: 5,
|
|
1317
1326
|
name: {
|
|
1318
|
-
children:
|
|
1319
|
-
|
|
1327
|
+
children: (
|
|
1328
|
+
<>
|
|
1329
|
+
<Icon name="download" />
|
|
1330
|
+
Ethan Hunt
|
|
1331
|
+
</>
|
|
1332
|
+
),
|
|
1320
1333
|
value: 'Ethan Hunt',
|
|
1321
1334
|
onClick: () => {
|
|
1322
1335
|
setActivePersonId(5);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Button } from 'Components/button/Button';
|
|
2
|
+
import { Icon } from 'Components/icon/Icon';
|
|
2
3
|
import { Dropdown } from 'Components/dropdown/Dropdown';
|
|
3
4
|
import { useEffect, useState } from 'react';
|
|
4
5
|
import { useGridApi } from 'Utils/hooks/useGridApi';
|
|
@@ -58,8 +59,9 @@ export const PageSizeSelector = (props: PageSizeSelectorProps) => {
|
|
|
58
59
|
return (
|
|
59
60
|
<Dropdown>
|
|
60
61
|
<Dropdown.Trigger>
|
|
61
|
-
<Button variant="dropdown"
|
|
62
|
+
<Button variant="dropdown" aria-label="Select page size">
|
|
62
63
|
{selectedPageSize}
|
|
64
|
+
<Icon name="chevron-down" />
|
|
63
65
|
</Button>
|
|
64
66
|
</Dropdown.Trigger>
|
|
65
67
|
<Dropdown.Content>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Button } from 'Components/button/Button';
|
|
2
|
+
import { Icon } from 'Components/icon/Icon';
|
|
2
3
|
import { NumberInput } from 'Components/formField/inputs/number/NumberInput';
|
|
3
4
|
import { useEffect, useState } from 'react';
|
|
4
5
|
import { useGridApi } from 'Utils/hooks/useGridApi';
|
|
@@ -54,21 +55,23 @@ export const PaginationControls = (props: PaginationControlsProps) => {
|
|
|
54
55
|
borderless
|
|
55
56
|
size="S"
|
|
56
57
|
color="black"
|
|
57
|
-
|
|
58
|
-
iconLeftScreenReaderText="Go to first page"
|
|
58
|
+
isRound
|
|
59
59
|
onClick={() => goToPage(1)}
|
|
60
60
|
disabled={inputValue === 1}
|
|
61
|
-
|
|
61
|
+
>
|
|
62
|
+
<Icon name="chevrons-left" screenReaderText="Go to first page" />
|
|
63
|
+
</Button>
|
|
62
64
|
<Button
|
|
63
65
|
variant="secondary"
|
|
64
66
|
borderless
|
|
65
67
|
size="S"
|
|
66
68
|
color="black"
|
|
67
|
-
|
|
69
|
+
isRound
|
|
68
70
|
onClick={() => goToPage(inputValue - 1)}
|
|
69
|
-
iconLeftScreenReaderText="Go to previous page"
|
|
70
71
|
disabled={inputValue === 1}
|
|
71
|
-
|
|
72
|
+
>
|
|
73
|
+
<Icon name="chevron-left" screenReaderText="Go to previous page" />
|
|
74
|
+
</Button>
|
|
72
75
|
<span>
|
|
73
76
|
Page
|
|
74
77
|
{' '}
|
|
@@ -97,20 +100,22 @@ export const PaginationControls = (props: PaginationControlsProps) => {
|
|
|
97
100
|
variant="secondary"
|
|
98
101
|
borderless
|
|
99
102
|
color="black"
|
|
100
|
-
|
|
103
|
+
isRound
|
|
101
104
|
onClick={() => goToPage(inputValue + 1)}
|
|
102
105
|
disabled={inputValue === totalPages}
|
|
103
|
-
|
|
104
|
-
|
|
106
|
+
>
|
|
107
|
+
<Icon name="chevron-right" screenReaderText="Go to next page" />
|
|
108
|
+
</Button>
|
|
105
109
|
<Button
|
|
106
110
|
variant="secondary"
|
|
107
111
|
borderless
|
|
108
112
|
color="black"
|
|
109
|
-
|
|
113
|
+
isRound
|
|
110
114
|
onClick={() => goToPage(totalPages)}
|
|
111
115
|
disabled={inputValue === totalPages}
|
|
112
|
-
|
|
113
|
-
|
|
116
|
+
>
|
|
117
|
+
<Icon name="chevrons-right" screenReaderText="Go to last page" />
|
|
118
|
+
</Button>
|
|
114
119
|
</div>
|
|
115
120
|
);
|
|
116
121
|
};
|
|
@@ -2,6 +2,7 @@ import { useContext } from 'react';
|
|
|
2
2
|
import { GridApiContext } from '../GridApiContext.js';
|
|
3
3
|
import type { GridApi } from 'ag-grid-community';
|
|
4
4
|
import { Button } from 'Components/button/Button';
|
|
5
|
+
import { Icon } from 'Components/icon/Icon';
|
|
5
6
|
import { Dropdown } from 'Components/dropdown/Dropdown';
|
|
6
7
|
|
|
7
8
|
export type BulkAction = {
|
|
@@ -21,10 +22,11 @@ export const BulkActionsDropdown = (props: BulkActionsDropdownProps) => {
|
|
|
21
22
|
return (
|
|
22
23
|
<Dropdown>
|
|
23
24
|
<Dropdown.Trigger>
|
|
24
|
-
<Button variant="dropdown"
|
|
25
|
+
<Button variant="dropdown">
|
|
25
26
|
Actions (
|
|
26
27
|
{actions.length}
|
|
27
28
|
)
|
|
29
|
+
<Icon name="chevron-down" />
|
|
28
30
|
</Button>
|
|
29
31
|
</Dropdown.Trigger>
|
|
30
32
|
<Dropdown.Content>
|