@lablup/ui-common 0.2.0-alpha.17 → 0.2.0-alpha.19
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/README.md +3 -2
- package/astryx/components/Board.doc.mjs +122 -0
- package/astryx/components/Board.tsx +3 -0
- package/astryx/components/Form.doc.mjs +1 -1
- package/astryx/docs/ui-common.doc.mjs +1 -1
- package/dist/assets/components/Board/Board.css +2 -0
- package/dist/assets/components/Form/FormItemVisual.css +1 -1
- package/dist/astryx/DateInput/tokens.stylex.d.ts +1 -0
- package/dist/astryx/DateInput/tokens.stylex.js +1 -0
- package/dist/astryx/Icon/IconSize.stylex.d.ts +1 -0
- package/dist/astryx/Icon/IconSize.stylex.js +1 -0
- package/dist/astryx/Indicator/indicator.markers.stylex.d.ts +1 -0
- package/dist/astryx/Indicator/indicator.markers.stylex.js +1 -0
- package/dist/astryx/Layer/layerAnimations.stylex.d.ts +1 -0
- package/dist/astryx/Layer/layerAnimations.stylex.js +1 -0
- package/dist/astryx/Layer/layerTextReset.stylex.d.ts +1 -0
- package/dist/astryx/Layer/layerTextReset.stylex.js +1 -0
- package/dist/astryx/Layer/layerViewportInset.stylex.d.ts +1 -0
- package/dist/astryx/Layer/layerViewportInset.stylex.js +1 -0
- package/dist/astryx/Layout/container.stylex.d.ts +1 -0
- package/dist/astryx/Layout/container.stylex.js +1 -0
- package/dist/astryx/Layout/edgeCompensation.stylex.d.ts +1 -0
- package/dist/astryx/Layout/edgeCompensation.stylex.js +1 -0
- package/dist/astryx/Layout/padding.stylex.d.ts +1 -0
- package/dist/astryx/Layout/padding.stylex.js +1 -0
- package/dist/astryx/Markdown/plugin-renderer.d.ts +1 -0
- package/dist/astryx/Markdown/plugin-renderer.js +1 -0
- package/dist/astryx/NavItem/navItemStyles.stylex.d.ts +1 -0
- package/dist/astryx/NavItem/navItemStyles.stylex.js +1 -0
- package/dist/astryx/Selector/selectorPresentation.stylex.d.ts +1 -0
- package/dist/astryx/Selector/selectorPresentation.stylex.js +1 -0
- package/dist/astryx/Stack/stack.stylex.d.ts +1 -0
- package/dist/astryx/Stack/stack.stylex.js +1 -0
- package/dist/astryx/Stack/stackItem.stylex.d.ts +1 -0
- package/dist/astryx/Stack/stackItem.stylex.js +1 -0
- package/dist/astryx/Text/text.stylex.d.ts +1 -0
- package/dist/astryx/Text/text.stylex.js +1 -0
- package/dist/astryx/theme/dataTokens.stylex.d.ts +1 -0
- package/dist/astryx/theme/dataTokens.stylex.js +1 -0
- package/dist/astryx/theme/neutral/fonts.css +3 -0
- package/dist/astryx/utils/focusOutline.stylex.d.ts +1 -0
- package/dist/astryx/utils/focusOutline.stylex.js +1 -0
- package/dist/astryx/utils/interactionOverlay.stylex.d.ts +1 -0
- package/dist/astryx/utils/interactionOverlay.stylex.js +1 -0
- package/dist/components/Board/Board.d.ts +102 -0
- package/dist/components/Board/Board.messages.d.ts +62 -0
- package/dist/components/Board/Board.messages.js +68 -0
- package/dist/components/Board/Board.messages.js.map +1 -0
- package/dist/components/Board/Board2.js +607 -0
- package/dist/components/Board/Board2.js.map +1 -0
- package/dist/components/Board/engine.d.ts +60 -0
- package/dist/components/Board/engine.js +397 -0
- package/dist/components/Board/engine.js.map +1 -0
- package/dist/components/Board/index.d.ts +4 -0
- package/dist/components/Board/index.js +3 -0
- package/dist/components/Board/layout.d.ts +81 -0
- package/dist/components/Board/layout.js +67 -0
- package/dist/components/Board/layout.js.map +1 -0
- package/dist/components/Board/scroll.d.ts +38 -0
- package/dist/components/Board/scroll.js +42 -0
- package/dist/components/Board/scroll.js.map +1 -0
- package/dist/components/DataGrid/DataGrid2.js +128 -128
- package/dist/components/DataGrid/DataGrid2.js.map +1 -1
- package/dist/components/Form/FormItem.d.ts +6 -1
- package/dist/components/Form/FormItem.js +68 -67
- package/dist/components/Form/FormItem.js.map +1 -1
- package/dist/components/Form/FormItemVisual.d.ts +7 -0
- package/dist/components/Form/FormItemVisual2.js +60 -55
- package/dist/components/Form/FormItemVisual2.js.map +1 -1
- package/dist/components/NotificationStack/NotificationStack2.js +1 -0
- package/dist/components/NotificationStack/NotificationStack2.js.map +1 -1
- package/dist/components/PageHeader/PageHeader2.js +4 -4
- package/dist/components/PagedSelector/PagedSelector.d.ts +1 -1
- package/dist/components/PagedSelector/PagedSelector2.js +37 -37
- package/dist/components/PagedSelector/PagedSelector2.js.map +1 -1
- package/dist/components/SelectionLabel/SelectionLabel.js +4 -4
- package/dist/forks/ComplexSelector/ComplexSelector.d.ts +82 -6
- package/dist/forks/ComplexSelector/ComplexSelector.js +170 -114
- package/dist/forks/ComplexSelector/ComplexSelector.js.map +1 -1
- package/dist/forks/ComplexSelector/ComplexSelector.styles.d.ts +40 -0
- package/dist/forks/ComplexSelector/ComplexSelector.styles.js +46 -6
- package/dist/forks/ComplexSelector/ComplexSelector.styles.js.map +1 -1
- package/dist/forks/ComplexSelector/index.d.ts +1 -1
- package/dist/forks/Drawer/Drawer.d.ts +21 -3
- package/dist/forks/Drawer/Drawer.js +70 -65
- package/dist/forks/Drawer/Drawer.js.map +1 -1
- package/dist/forks/Drawer/Drawer.styles.d.ts +16 -0
- package/dist/forks/Drawer/Drawer.styles.js +16 -0
- package/dist/forks/Drawer/Drawer.styles.js.map +1 -1
- package/dist/forks/Drawer/useDrawerDialogPresence.js.map +1 -1
- package/dist/forks/Tour/Tour.js +38 -40
- package/dist/forks/Tour/Tour.js.map +1 -1
- package/dist/forks/Tour/TourContext.js.map +1 -1
- package/dist/forks/Tour/TourStep.js.map +1 -1
- package/dist/forks/Tour/TourStep.styles.js.map +1 -1
- package/dist/forks/Tour/useTour.js.map +1 -1
- package/dist/i18n/catalog.js +27 -25
- package/dist/i18n/catalog.js.map +1 -1
- package/dist/i18n/locales/de-DE.js +60 -0
- package/dist/i18n/locales/de-DE.js.map +1 -1
- package/dist/i18n/locales/el-GR.js +60 -0
- package/dist/i18n/locales/el-GR.js.map +1 -1
- package/dist/i18n/locales/es-ES.js +60 -0
- package/dist/i18n/locales/es-ES.js.map +1 -1
- package/dist/i18n/locales/fi-FI.js +60 -0
- package/dist/i18n/locales/fi-FI.js.map +1 -1
- package/dist/i18n/locales/fr-FR.js +60 -0
- package/dist/i18n/locales/fr-FR.js.map +1 -1
- package/dist/i18n/locales/id-ID.js +60 -0
- package/dist/i18n/locales/id-ID.js.map +1 -1
- package/dist/i18n/locales/it-IT.js +60 -0
- package/dist/i18n/locales/it-IT.js.map +1 -1
- package/dist/i18n/locales/ja-JP.js +60 -0
- package/dist/i18n/locales/ja-JP.js.map +1 -1
- package/dist/i18n/locales/ko-KR.js +60 -0
- package/dist/i18n/locales/ko-KR.js.map +1 -1
- package/dist/i18n/locales/mn-MN.js +60 -0
- package/dist/i18n/locales/mn-MN.js.map +1 -1
- package/dist/i18n/locales/ms-MY.js +60 -0
- package/dist/i18n/locales/ms-MY.js.map +1 -1
- package/dist/i18n/locales/pl-PL.js +60 -0
- package/dist/i18n/locales/pl-PL.js.map +1 -1
- package/dist/i18n/locales/pt-BR.js +60 -0
- package/dist/i18n/locales/pt-BR.js.map +1 -1
- package/dist/i18n/locales/pt-PT.js +60 -0
- package/dist/i18n/locales/pt-PT.js.map +1 -1
- package/dist/i18n/locales/ru-RU.js +60 -0
- package/dist/i18n/locales/ru-RU.js.map +1 -1
- package/dist/i18n/locales/th-TH.js +60 -0
- package/dist/i18n/locales/th-TH.js.map +1 -1
- package/dist/i18n/locales/tr-TR.js +60 -0
- package/dist/i18n/locales/tr-TR.js.map +1 -1
- package/dist/i18n/locales/vi-VN.js +60 -0
- package/dist/i18n/locales/vi-VN.js.map +1 -1
- package/dist/i18n/locales/zh-CN.js +60 -0
- package/dist/i18n/locales/zh-CN.js.map +1 -1
- package/dist/i18n/locales/zh-TW.js +60 -0
- package/dist/i18n/locales/zh-TW.js.map +1 -1
- package/dist/index.d.ts +7 -5
- package/dist/index.js +61 -59
- package/dist/instance.js +2 -2
- package/dist/locales/en.generated.js +34 -0
- package/dist/locales/en.json +136 -0
- package/dist/locales/pseudo.generated.js +34 -0
- package/dist/locales/pseudo.json +102 -0
- package/dist/theme/lablup/built/lablup.d.ts +3 -3
- package/dist/theme/lablup/built/lablup.js +24 -5
- package/dist/theme/lablup/built/lablup.variants.d.ts +2 -2
- package/dist/theme/lablup/built/theme.css +70 -63
- package/dist/theme/lablup/built/theme.css.d.ts +9 -0
- package/dist/ui-common-locales/de-DE.json +60 -0
- package/dist/ui-common-locales/el-GR.json +60 -0
- package/dist/ui-common-locales/en.json +60 -0
- package/dist/ui-common-locales/es-ES.json +60 -0
- package/dist/ui-common-locales/fi-FI.json +60 -0
- package/dist/ui-common-locales/fr-FR.json +60 -0
- package/dist/ui-common-locales/id-ID.json +60 -0
- package/dist/ui-common-locales/it-IT.json +60 -0
- package/dist/ui-common-locales/ja-JP.json +60 -0
- package/dist/ui-common-locales/ko-KR.json +60 -0
- package/dist/ui-common-locales/mn-MN.json +60 -0
- package/dist/ui-common-locales/ms-MY.json +60 -0
- package/dist/ui-common-locales/pl-PL.json +60 -0
- package/dist/ui-common-locales/pt-BR.json +60 -0
- package/dist/ui-common-locales/pt-PT.json +60 -0
- package/dist/ui-common-locales/ru-RU.json +60 -0
- package/dist/ui-common-locales/th-TH.json +60 -0
- package/dist/ui-common-locales/tr-TR.json +60 -0
- package/dist/ui-common-locales/vi-VN.json +60 -0
- package/dist/ui-common-locales/zh-CN.json +60 -0
- package/dist/ui-common-locales/zh-TW.json +60 -0
- package/exports.customs.json +1 -0
- package/package.json +86 -6
package/README.md
CHANGED
|
@@ -102,14 +102,14 @@ there):
|
|
|
102
102
|
|
|
103
103
|
```yaml
|
|
104
104
|
overrides:
|
|
105
|
-
"@astryxdesign/lab>@astryxdesign/core": "0.
|
|
105
|
+
"@astryxdesign/lab>@astryxdesign/core": "0.7.0"
|
|
106
106
|
```
|
|
107
107
|
|
|
108
108
|
npm, in the root `package.json`:
|
|
109
109
|
|
|
110
110
|
```json
|
|
111
111
|
"overrides": {
|
|
112
|
-
"@astryxdesign/lab": { "@astryxdesign/core": "0.
|
|
112
|
+
"@astryxdesign/lab": { "@astryxdesign/core": "0.7.0" }
|
|
113
113
|
}
|
|
114
114
|
```
|
|
115
115
|
|
|
@@ -293,6 +293,7 @@ import { Modal } from "@lablup/ui-common/Modal";
|
|
|
293
293
|
| `AlertModal` | An alert dialog, in place of Astryx `AlertDialog` | `/AlertModal` |
|
|
294
294
|
| `DeleteConfirmModal` | Confirms a deletion, with typed confirmation when needed | `/components/DeleteConfirmModal` |
|
|
295
295
|
| `StepNumberInput`, `NumberStepper` | A number field that steps along a list of values | `/components/StepNumberInput` |
|
|
296
|
+
| `Board` | A dashboard grid of movable, resizable items | `/components/Board` |
|
|
296
297
|
| `BoardItemTitle` | A dashboard panel's sticky title row | `/components/BoardItemTitle` |
|
|
297
298
|
| `Statistic` | A metric with a caption, a large value and a notched bar | `/components/Statistic` |
|
|
298
299
|
| `DividedRow` | A wrapping row with dividers between neighbours on a line | `/components/DividedRow` |
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `astryx component Board` (and `ui-common component Board`).
|
|
3
|
+
*
|
|
4
|
+
* @type {import('@astryxdesign/cli/authoring').ComponentDoc}
|
|
5
|
+
*/
|
|
6
|
+
export default {
|
|
7
|
+
type: "component",
|
|
8
|
+
name: "Board",
|
|
9
|
+
displayName: "Board",
|
|
10
|
+
import: "@lablup/ui-common",
|
|
11
|
+
category: "Layout",
|
|
12
|
+
keywords: [
|
|
13
|
+
"board",
|
|
14
|
+
"dashboard",
|
|
15
|
+
"grid",
|
|
16
|
+
"drag",
|
|
17
|
+
"resize",
|
|
18
|
+
"panel",
|
|
19
|
+
"widget",
|
|
20
|
+
"layout",
|
|
21
|
+
],
|
|
22
|
+
description:
|
|
23
|
+
"A dashboard grid of items the user can move and resize, by pointer or keyboard. The column count follows the board's width (1, 2, 4 or 6 columns by default); each item persists as its spans plus a column offset per column count, the model of @cloudscape-design/board-components, so a layout stored by that board renders the same here. Controlled: onItemsChange reports the whole board in its new order and the parent passes it back.",
|
|
24
|
+
props: [
|
|
25
|
+
{
|
|
26
|
+
name: "items",
|
|
27
|
+
type: "ReadonlyArray<BoardItem<D>>",
|
|
28
|
+
description:
|
|
29
|
+
"The items: id, data, optional rowSpan (from 2) and columnSpan (from 1), definition (minRowSpan, minColumnSpan, defaultRowSpan, defaultColumnSpan) and columnOffset, a column per column count ({ 4: 2, 6: 3 }) the board writes back.",
|
|
30
|
+
required: true,
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: "renderItem",
|
|
34
|
+
type: "(item: BoardItem<D>, actions: { removeItem: () => void }) => ReactNode",
|
|
35
|
+
description:
|
|
36
|
+
"An item's content. The board draws the surface, border and handles around it; the content area scrolls, so a BoardItemTitle inside stays at the top. removeItem reports the board without the item.",
|
|
37
|
+
required: true,
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: "onItemsChange",
|
|
41
|
+
type: "(detail: BoardItemsChangeDetail<D>) => void",
|
|
42
|
+
description:
|
|
43
|
+
"Called when the user moves, resizes or removes an item, with items (the whole board in its new order, spans and columnOffset updated) and the movedItem, resizedItem or removedItem. A move that ends where it started does not fire.",
|
|
44
|
+
required: true,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: "isMovable",
|
|
48
|
+
type: "boolean",
|
|
49
|
+
description: "Renders a drag handle at each item's top-left corner.",
|
|
50
|
+
default: "false",
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: "isResizable",
|
|
54
|
+
type: "boolean",
|
|
55
|
+
description: "Renders a resize handle at each item's bottom-right corner.",
|
|
56
|
+
default: "false",
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: "variant",
|
|
60
|
+
type: "'bordered' | 'plain'",
|
|
61
|
+
description: "bordered draws a border on each item.",
|
|
62
|
+
default: "'plain'",
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: "emptyContent",
|
|
66
|
+
type: "ReactNode",
|
|
67
|
+
description: "Rendered in place of the grid when items is empty.",
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: "columnBreakpoints",
|
|
71
|
+
type: "ReadonlyArray<{ minWidth: number; columns: number }>",
|
|
72
|
+
description: "Content width (px) to column count.",
|
|
73
|
+
default: "1 under 688px, 2 under 912px, 4 under 2100px, else 6",
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: "itemClassName",
|
|
77
|
+
type: "string | ((item: BoardItem<D>) => string | undefined)",
|
|
78
|
+
description: "An extra class on each item's surface.",
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: "dragHandleIcon, resizeHandleIcon",
|
|
82
|
+
type: "ReactNode",
|
|
83
|
+
description: "The handles' glyphs.",
|
|
84
|
+
default: "a grip, a corner grip",
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
name: "dragHandleLabel, resizeHandleLabel",
|
|
88
|
+
type: "string",
|
|
89
|
+
description: "Accessible names of the handles.",
|
|
90
|
+
default: "the catalog's uic.Board.dragHandle / resizeHandle",
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: "liveAnnouncementDndStarted, liveAnnouncementDndCommitted, liveAnnouncementDndDiscarded",
|
|
94
|
+
type: "(operation: 'move' | 'resize') => string",
|
|
95
|
+
description:
|
|
96
|
+
"Live-region announcements at the start and end of a move or resize.",
|
|
97
|
+
default: "the catalog's uic.Board.* keys",
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
name: "liveAnnouncementDndItemMoved, liveAnnouncementDndItemResized",
|
|
101
|
+
type: "(detail: { item: BoardItem<D>; placement: { x; y; width; height } }) => string",
|
|
102
|
+
description: "Live-region announcement at each step; the placement is 0-based.",
|
|
103
|
+
default: "the catalog's uic.Board.itemMoved / itemResized",
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
name: "liveAnnouncementItemRemoved",
|
|
107
|
+
type: "(detail: { item: BoardItem<D> }) => string",
|
|
108
|
+
description: "Live-region announcement when an item is removed.",
|
|
109
|
+
default: "the catalog's uic.Board.itemRemoved",
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
usage: {
|
|
113
|
+
description:
|
|
114
|
+
"Persist what onItemsChange reports (minus data) and pass it back as items; the board snaps back otherwise. Drag a handle to move or resize by pointer (a resized item follows the pointer's size and snaps to the grid on release). Click a handle, or press Enter or Space on it, to activate it: direction buttons appear and they or the arrow keys step one cell, Enter, Space or leaving the handle commits, Escape discards. A step that would overlap an item only partly, in the direction of the move, is a conflict and does not commit. The drag handle overlays the item's top-left corner, so give the content a horizontal inset. A pointer drag held near an edge of the nearest scroll container scrolls it. CSS knobs on the root or above: --board-row-height (96px), --board-gap (--spacing-5), --board-item-radius (--radius-container), --board-transition-duration (200ms, off under prefers-reduced-motion), --board-handle-z (51; BoardItemTitle's sticky row is 50). Other div attributes reach the root.",
|
|
115
|
+
},
|
|
116
|
+
examples: [
|
|
117
|
+
{
|
|
118
|
+
label: "A movable, resizable dashboard",
|
|
119
|
+
code: '<Board\n items={items}\n isMovable\n isResizable\n variant="bordered"\n renderItem={(item) => (\n <Stack gap={2} xstyle={inset}>\n <BoardItemTitle title={item.data.title} />\n {item.data.content}\n </Stack>\n )}\n onItemsChange={({ items }) => setItems(items)}\n/>',
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
};
|
|
@@ -102,7 +102,7 @@ export default {
|
|
|
102
102
|
],
|
|
103
103
|
usage: {
|
|
104
104
|
description:
|
|
105
|
-
"Data-entry screens whose state, validation and submit need more than a few controlled fields. Style hooks: .uic-form-item and its __label, __control, __explain-error, __extra elements, and --form-item-margin-bottom, --form-item-gap and --form-item-line-height. Help, extra and the tooltip glyph take the theme's --color-text-description when it declares one (default --color-text-secondary). A control reaches its item's status through Form.Item.useStatus() or FormItemInputContext.",
|
|
105
|
+
"Data-entry screens whose state, validation and submit need more than a few controlled fields. Form.Item's labelExtra puts actions (a filter or sort toggle) in the label row, outside the <label> so they stay out of the control's accessible name: at the far end in vertical layout, right after the label otherwise. Style hooks: .uic-form-item and its __label, __label-extra, __control, __explain-error, __extra elements, and --form-item-margin-bottom, --form-item-gap and --form-item-line-height. Help, extra and the tooltip glyph take the theme's --color-text-description when it declares one (default --color-text-secondary). A control reaches its item's status through Form.Item.useStatus() or FormItemInputContext.",
|
|
106
106
|
},
|
|
107
107
|
examples: [
|
|
108
108
|
{
|
|
@@ -69,7 +69,7 @@ export const docs = {
|
|
|
69
69
|
"`AlertModal`: the alert-dialog pattern on Modal, in its level stack. ui-common hides AlertDialog; use this.",
|
|
70
70
|
"`DeleteConfirmModal`: confirms a deletion on Modal; typed confirmation for irreversible ones.",
|
|
71
71
|
"`StepNumberInput`: a number field that steps along a list of values (1, 2, 4, 8); `NumberStepper` is its stepper column.",
|
|
72
|
-
"`BoardItemTitle`: a dashboard panel's sticky title row, with a help tooltip and actions at the end.",
|
|
72
|
+
"`Board`: a dashboard grid of items the user moves and resizes by pointer or keyboard; items persist as spans plus a column offset per column count, as in Cloudscape's board. `BoardItemTitle`: a dashboard panel's sticky title row, with a help tooltip and actions at the end.",
|
|
73
73
|
"`Statistic`: a metric with a caption, a large value and a notched usage bar. `DividedRow`: a wrapping row with dividers between neighbours on a line.",
|
|
74
74
|
'`TokenList`: values inline, the rest behind +N on hover. `TokenRow`: tokens cut off with "and N more".',
|
|
75
75
|
"`NotificationItem`: the title, description, actions and footer of one notice.",
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
@layer reset, theme, base, astryx-base, astryx-theme, ui-common, components, utilities;
|
|
2
|
+
@layer ui-common{.uic-board{min-width:0;position:relative}.uic-board__grid{grid-auto-rows:var(--board-row-height,96px);gap:var(--board-gap,var(--spacing-5));display:grid}.uic-board__placeholder{border-radius:var(--board-item-radius,var(--radius-container))}.uic-board__placeholder--active{background-color:var(--color-background-muted)}.uic-board__placeholder--hover{background-color:var(--color-accent-muted)}.uic-board-item{isolation:isolate;border-radius:var(--board-item-radius,var(--radius-container));background-color:var(--color-background-surface);flex-direction:column;height:100%;min-height:0;display:flex;position:relative}.uic-board-item--sliding{transition:transform var(--board-transition-duration,.2s) var(--ease-standard)}.uic-board-item--bordered{border:var(--border-width) solid var(--color-border)}.uic-board-item--active{z-index:1;box-shadow:0 0 0 var(--spacing-0-5) var(--color-accent)}.uic-board-item--dragging,.uic-board-item--resizing{transition:none}.uic-board-item--resizing{place-self:start}.uic-board-item__content{border-radius:inherit;flex:1;min-height:0;overflow:auto}.uic-board-item__handle{z-index:var(--board-handle-z,51);display:inline-flex;position:absolute}.uic-board-item__handle--drag{inset-block-start:var(--spacing-2);inset-inline-start:var(--spacing-1)}.uic-board-item__handle--resize{inset-block-end:0;inset-inline-end:0}.uic-board-item__drag-handle,.uic-board-item__resize-handle,.uic-board-item__drag-handle:hover,.uic-board-item__resize-handle:hover,.uic-board-item__drag-handle:active,.uic-board-item__resize-handle:active{background-color:#0000}.uic-board-item__drag-handle,.uic-board-item__resize-handle{color:var(--color-icon-disabled);touch-action:none}.uic-board-item__drag-handle:hover,.uic-board-item__resize-handle:hover,.uic-board-item--active .uic-board-item__drag-handle,.uic-board-item--active .uic-board-item__resize-handle{color:var(--color-icon-primary)}.uic-board-item__drag-handle{cursor:grab}.uic-board-item--dragging .uic-board-item__drag-handle{cursor:grabbing}.uic-board-item__resize-handle{cursor:nwse-resize}.uic-board__direction{appearance:none;font:inherit;box-sizing:border-box;width:var(--spacing-6);height:var(--spacing-6);border:var(--border-width) solid var(--color-border);border-radius:var(--radius-full);background-color:var(--color-background-surface);color:var(--color-icon-primary);box-shadow:var(--shadow-low);cursor:pointer;-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;padding:0;display:inline-flex;position:absolute}.uic-board__direction:hover{background-color:var(--color-background-muted)}.uic-board__direction--up{inset-block-start:calc(-1 * (var(--spacing-6) + var(--spacing-1)));inset-inline-start:calc(50% - var(--spacing-3))}.uic-board__direction--down{inset-block-end:calc(-1 * (var(--spacing-6) + var(--spacing-1)));inset-inline-start:calc(50% - var(--spacing-3))}.uic-board__direction--left{inset-block-start:calc(50% - var(--spacing-3));inset-inline-start:calc(-1 * (var(--spacing-6) + var(--spacing-1)))}.uic-board__direction--right{inset-block-start:calc(50% - var(--spacing-3));inset-inline-end:calc(-1 * (var(--spacing-6) + var(--spacing-1)))}@media (prefers-reduced-motion:reduce){.uic-board-item--sliding{transition:none}}}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
@layer reset, theme, base, astryx-base, astryx-theme, ui-common, components, utilities;
|
|
2
|
-
@layer ui-common{.uic-form[data-layout=inline]{flex-wrap:wrap;display:flex}.uic-form[data-layout=inline]>.uic-form-item,.uic-form[data-layout=inline] .uic-form-item[data-layout=inline]{flex:none;margin-inline-end:var(--spacing-4)}.uic-form-item{box-sizing:border-box;vertical-align:top;margin-bottom:var(--form-item-margin-bottom,var(--spacing-6));font-size:var(--font-size-base);line-height:var(--form-item-line-height,var(--text-body-leading))}.uic-form-item[data-layout=inline]{margin-bottom:0}.uic-form-item[data-hidden]{display:none}.uic-form-item__row{flex-flow:wrap;min-width:0;display:flex}.uic-form-item[data-layout=vertical] .uic-form-item__row{flex-direction:column}.uic-form-item[data-layout=inline] .uic-form-item__row{flex-wrap:nowrap}.uic-form-item__label-col{white-space:nowrap;text-align:end;vertical-align:middle;box-sizing:border-box;flex-grow:0;max-width:100%;overflow:hidden}.uic-form-item__label-col[data-align=left]{text-align:start}.uic-form-item__label-col[data-wrap]{overflow:unset;line-height:var(--form-item-line-height,var(--text-body-leading));white-space:unset}.uic-form-item__label-col[data-wrap]>.uic-form-item__label{vertical-align:middle;text-wrap:balance}.uic-form-item[data-layout=vertical] .uic-form-item__label-col{padding:0 0 var(--form-item-gap,var(--spacing-2));white-space:initial;text-align:start;margin:0}.uic-form-item[data-layout=inline] .uic-form-item__label-col{flex:none}.uic-form-item__label{max-width:100%;height:var(--size-element-md);color:var(--color-text-primary);font-size:var(--font-size-base);line-height:var(--form-item-line-height,var(--text-body-leading));align-items:center;display:inline-flex;position:relative}.uic-form-item[data-layout=vertical] .uic-form-item__label{height:auto;margin:0}.uic-form-item[data-size=small] .uic-form-item__label{height:var(--size-element-sm)}.uic-form-item[data-size=large] .uic-form-item__label{height:var(--size-element-lg)}.uic-form-item__label--required:before{color:var(--color-error);font-size:var(--font-size-base);content:"*";margin-inline-end:var(--spacing-1);font-family:sans-serif;line-height:1;display:inline-block}.uic-form-item__label[data-required-mark]:before{display:none}.uic-form-item__label:after{content:":";margin-block:0;margin-inline-start:var(--spacing-0-5);margin-inline-end:var(--spacing-2);position:relative}.uic-form-item__label[data-no-colon]:after{content:" "}.uic-form-item[data-layout=vertical] .uic-form-item__label:after{visibility:hidden}.uic-form-item__optional{color:var(--color-text-description,var(--color-text-secondary));margin-inline-start:var(--spacing-1);display:inline-block}.uic-form-item__tooltip{color:var(--color-text-description,var(--color-text-secondary));cursor:help;writing-mode:horizontal-tb;align-items:center;margin-inline-start:var(--spacing-1);display:inline-flex}.uic-form-item__control{box-sizing:border-box;flex-direction:column;flex-grow:1;min-width:0;display:flex}.uic-form-item__row>.uic-form-item__control:first-child:not([data-span]){width:100%}.uic-form-item:not([data-layout=vertical]) .uic-form-item__label-col+.uic-form-item__control{flex:1 1 0}.uic-form-item[data-layout=vertical] .uic-form-item__control{width:100%}.uic-form-item__control-input{min-height:var(--size-element-md);align-items:center;display:flex;position:relative}.uic-form-item[data-size=small] .uic-form-item__control-input{min-height:var(--size-element-sm)}.uic-form-item[data-size=large] .uic-form-item__control-input{min-height:var(--size-element-lg)}.uic-form-item__control-input-content{flex:auto;max-width:100%}.uic-form-item__additional{flex-direction:column;display:flex}.uic-form-item__explain,.uic-form-item__extra{clear:both;color:var(--color-text-description,var(--color-text-secondary));font-size:var(--font-size-base);line-height:var(--form-item-line-height,var(--text-body-leading))}.uic-form-item__extra{min-height:var(--size-element-sm)}.uic-form-item__explain-error{color:var(--color-error)}.uic-form-item__explain-warning{color:var(--color-warning)}.uic-form-item__feedback-icon{inset-inline-end:var(--spacing-3);height:calc(var(--font-size-base) * var(--form-item-line-height,var(--text-body-leading)));color:var(--color-accent);font-size:var(--font-size-base);pointer-events:none;justify-content:center;align-items:center;display:inline-flex;position:absolute;top:50%;transform:translateY(-50%)}.uic-form-item__feedback-icon[data-status=success]{color:var(--color-success)}.uic-form-item__feedback-icon[data-status=warning]{color:var(--color-warning)}.uic-form-item__feedback-icon[data-status=error]{color:var(--color-error)}.uic-form-item__feedback-glyph[data-status=validating]{animation:1s linear infinite uic-form-item-feedback-spin}@keyframes uic-form-item-feedback-spin{to{transform:rotate(360deg)}}}
|
|
2
|
+
@layer ui-common{.uic-form[data-layout=inline]{flex-wrap:wrap;display:flex}.uic-form[data-layout=inline]>.uic-form-item,.uic-form[data-layout=inline] .uic-form-item[data-layout=inline]{flex:none;margin-inline-end:var(--spacing-4)}.uic-form-item{box-sizing:border-box;vertical-align:top;margin-bottom:var(--form-item-margin-bottom,var(--spacing-6));font-size:var(--font-size-base);line-height:var(--form-item-line-height,var(--text-body-leading))}.uic-form-item[data-layout=inline]{margin-bottom:0}.uic-form-item[data-hidden]{display:none}.uic-form-item__row{flex-flow:wrap;min-width:0;display:flex}.uic-form-item[data-layout=vertical] .uic-form-item__row{flex-direction:column}.uic-form-item[data-layout=inline] .uic-form-item__row{flex-wrap:nowrap}.uic-form-item__label-col{white-space:nowrap;text-align:end;vertical-align:middle;box-sizing:border-box;flex-grow:0;max-width:100%;overflow:hidden}.uic-form-item__label-col[data-align=left]{text-align:start}.uic-form-item__label-col[data-wrap]{overflow:unset;line-height:var(--form-item-line-height,var(--text-body-leading));white-space:unset}.uic-form-item__label-col[data-wrap]>.uic-form-item__label{vertical-align:middle;text-wrap:balance}.uic-form-item[data-layout=vertical] .uic-form-item__label-col{padding:0 0 var(--form-item-gap,var(--spacing-2));white-space:initial;text-align:start;margin:0}.uic-form-item[data-layout=inline] .uic-form-item__label-col{flex:none}.uic-form-item__label{max-width:100%;height:var(--size-element-md);color:var(--color-text-primary);font-size:var(--font-size-base);line-height:var(--form-item-line-height,var(--text-body-leading));align-items:center;display:inline-flex;position:relative}.uic-form-item[data-layout=vertical] .uic-form-item__label{height:auto;margin:0}.uic-form-item[data-size=small] .uic-form-item__label{height:var(--size-element-sm)}.uic-form-item[data-size=large] .uic-form-item__label{height:var(--size-element-lg)}.uic-form-item__label--required:before{color:var(--color-error);font-size:var(--font-size-base);content:"*";margin-inline-end:var(--spacing-1);font-family:sans-serif;line-height:1;display:inline-block}.uic-form-item__label[data-required-mark]:before{display:none}.uic-form-item__label:after{content:":";margin-block:0;margin-inline-start:var(--spacing-0-5);margin-inline-end:var(--spacing-2);position:relative}.uic-form-item__label[data-no-colon]:after{content:" "}.uic-form-item[data-layout=vertical] .uic-form-item__label:after{visibility:hidden}.uic-form-item__label-col[data-has-label-extra]{justify-content:flex-end;align-items:center;display:flex}.uic-form-item__label-col[data-has-label-extra][data-align=left]{justify-content:flex-start}.uic-form-item[data-layout=vertical] .uic-form-item__label-col[data-has-label-extra]{justify-content:space-between;overflow:visible}.uic-form-item__label-col[data-has-label-extra]>.uic-form-item__label{min-width:0}.uic-form-item__label-col[data-has-label-extra]:not([data-wrap])>.uic-form-item__label{overflow:hidden}.uic-form-item__label-col[data-has-label-extra]>.uic-form-item__label:after{content:none}.uic-form-item__label-extra{flex:none;align-items:center;margin-inline-start:var(--spacing-1);display:inline-flex}.uic-form-item__label-extra:after{content:":";margin-inline-start:var(--spacing-0-5);margin-inline-end:var(--spacing-2)}.uic-form-item__label-extra[data-no-colon]:after{content:" "}.uic-form-item[data-layout=vertical] .uic-form-item__label-extra:after{content:none}.uic-form-item__optional{color:var(--color-text-description,var(--color-text-secondary));margin-inline-start:var(--spacing-1);display:inline-block}.uic-form-item__tooltip{color:var(--color-text-description,var(--color-text-secondary));cursor:help;writing-mode:horizontal-tb;align-items:center;margin-inline-start:var(--spacing-1);display:inline-flex}.uic-form-item__control{box-sizing:border-box;flex-direction:column;flex-grow:1;min-width:0;display:flex}.uic-form-item__row>.uic-form-item__control:first-child:not([data-span]){width:100%}.uic-form-item:not([data-layout=vertical]) .uic-form-item__label-col+.uic-form-item__control{flex:1 1 0}.uic-form-item[data-layout=vertical] .uic-form-item__control{width:100%}.uic-form-item__control-input{min-height:var(--size-element-md);align-items:center;display:flex;position:relative}.uic-form-item[data-size=small] .uic-form-item__control-input{min-height:var(--size-element-sm)}.uic-form-item[data-size=large] .uic-form-item__control-input{min-height:var(--size-element-lg)}.uic-form-item__control-input-content{flex:auto;max-width:100%}.uic-form-item__additional{flex-direction:column;display:flex}.uic-form-item__explain,.uic-form-item__extra{clear:both;color:var(--color-text-description,var(--color-text-secondary));font-size:var(--font-size-base);line-height:var(--form-item-line-height,var(--text-body-leading))}.uic-form-item__extra{min-height:var(--size-element-sm)}.uic-form-item__explain-error{color:var(--color-error)}.uic-form-item__explain-warning{color:var(--color-warning)}.uic-form-item__feedback-icon{inset-inline-end:var(--spacing-3);height:calc(var(--font-size-base) * var(--form-item-line-height,var(--text-body-leading)));color:var(--color-accent);font-size:var(--font-size-base);pointer-events:none;justify-content:center;align-items:center;display:inline-flex;position:absolute;top:50%;transform:translateY(-50%)}.uic-form-item__feedback-icon[data-status=success]{color:var(--color-success)}.uic-form-item__feedback-icon[data-status=warning]{color:var(--color-warning)}.uic-form-item__feedback-icon[data-status=error]{color:var(--color-error)}.uic-form-item__feedback-glyph[data-status=validating]{animation:1s linear infinite uic-form-item-feedback-spin}@keyframes uic-form-item-feedback-spin{to{transform:rotate(360deg)}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@astryxdesign/core/DateInput/tokens.stylex';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@astryxdesign/core/DateInput/tokens.stylex";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@astryxdesign/core/Icon/IconSize.stylex';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@astryxdesign/core/Icon/IconSize.stylex";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@astryxdesign/core/Indicator/indicator.markers.stylex';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@astryxdesign/core/Indicator/indicator.markers.stylex";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@astryxdesign/core/Layer/layerAnimations.stylex';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@astryxdesign/core/Layer/layerAnimations.stylex";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@astryxdesign/core/Layer/layerTextReset.stylex';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@astryxdesign/core/Layer/layerTextReset.stylex";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@astryxdesign/core/Layer/layerViewportInset.stylex';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@astryxdesign/core/Layer/layerViewportInset.stylex";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@astryxdesign/core/Layout/container.stylex';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@astryxdesign/core/Layout/container.stylex";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@astryxdesign/core/Layout/edgeCompensation.stylex';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@astryxdesign/core/Layout/edgeCompensation.stylex";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@astryxdesign/core/Layout/padding.stylex';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@astryxdesign/core/Layout/padding.stylex";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@astryxdesign/core/Markdown/plugin-renderer';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@astryxdesign/core/Markdown/plugin-renderer";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@astryxdesign/core/NavItem/navItemStyles.stylex';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@astryxdesign/core/NavItem/navItemStyles.stylex";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@astryxdesign/core/Selector/selectorPresentation.stylex';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@astryxdesign/core/Selector/selectorPresentation.stylex";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@astryxdesign/core/Stack/stack.stylex';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@astryxdesign/core/Stack/stack.stylex";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@astryxdesign/core/Stack/stackItem.stylex';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@astryxdesign/core/Stack/stackItem.stylex";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@astryxdesign/core/Text/text.stylex';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@astryxdesign/core/Text/text.stylex";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@astryxdesign/core/theme/dataTokens.stylex';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@astryxdesign/core/theme/dataTokens.stylex";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@astryxdesign/core/utils/focusOutline.stylex';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@astryxdesign/core/utils/focusOutline.stylex";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@astryxdesign/core/utils/interactionOverlay.stylex';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@astryxdesign/core/utils/interactionOverlay.stylex";
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { Rect } from './engine';
|
|
3
|
+
import { BoardItem } from './layout';
|
|
4
|
+
export type BoardOperation = "move" | "resize";
|
|
5
|
+
export interface BoardItemPlacement {
|
|
6
|
+
/** Column, from 0. */
|
|
7
|
+
x: number;
|
|
8
|
+
/** Row, from 0. */
|
|
9
|
+
y: number;
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
}
|
|
13
|
+
export interface BoardDndDetail<D = unknown> {
|
|
14
|
+
item: BoardItem<D>;
|
|
15
|
+
/** Where the item is at this step. */
|
|
16
|
+
placement: BoardItemPlacement;
|
|
17
|
+
}
|
|
18
|
+
export interface BoardItemRemovedDetail<D = unknown> {
|
|
19
|
+
item: BoardItem<D>;
|
|
20
|
+
}
|
|
21
|
+
export interface BoardItemsChangeDetail<D = unknown> {
|
|
22
|
+
/** The whole board in its new order, spans and column offsets updated. */
|
|
23
|
+
items: ReadonlyArray<BoardItem<D>>;
|
|
24
|
+
movedItem?: BoardItem<D>;
|
|
25
|
+
resizedItem?: BoardItem<D>;
|
|
26
|
+
removedItem?: BoardItem<D>;
|
|
27
|
+
}
|
|
28
|
+
export interface BoardItemActions {
|
|
29
|
+
/** Removes the item: `onItemsChange` fires with the rest, re-laid out. */
|
|
30
|
+
removeItem: () => void;
|
|
31
|
+
}
|
|
32
|
+
export interface BoardColumnBreakpoint {
|
|
33
|
+
/** The least content width, in px, at which the board has `columns` columns. */
|
|
34
|
+
minWidth: number;
|
|
35
|
+
columns: number;
|
|
36
|
+
}
|
|
37
|
+
/** Cloudscape's: 1 column under 688px, 2 under 912px, 4 under 2100px, else 6. */
|
|
38
|
+
export declare const DEFAULT_BOARD_COLUMN_BREAKPOINTS: ReadonlyArray<BoardColumnBreakpoint>;
|
|
39
|
+
/** How far a pointer travels before a press on a handle is a drag, not a click. */
|
|
40
|
+
export declare const CLICK_DRAG_THRESHOLD_PX = 3;
|
|
41
|
+
export interface BoardProps<D = unknown> extends Omit<HTMLAttributes<HTMLDivElement>, "children" | "onChange"> {
|
|
42
|
+
items: ReadonlyArray<BoardItem<D>>;
|
|
43
|
+
/** An item's content. The board draws the surface, border and handles around it. */
|
|
44
|
+
renderItem: (item: BoardItem<D>, actions: BoardItemActions) => ReactNode;
|
|
45
|
+
/** Called when the user moves, resizes or removes an item. */
|
|
46
|
+
onItemsChange: (detail: BoardItemsChangeDetail<D>) => void;
|
|
47
|
+
/** Whether items have a drag handle and can be moved. @default false */
|
|
48
|
+
isMovable?: boolean;
|
|
49
|
+
/** Whether items have a resize handle and can be resized. @default false */
|
|
50
|
+
isResizable?: boolean;
|
|
51
|
+
/** `bordered` draws a border on each item. @default 'plain' */
|
|
52
|
+
variant?: "bordered" | "plain";
|
|
53
|
+
/** Rendered in place of the grid when there are no items. */
|
|
54
|
+
emptyContent?: ReactNode;
|
|
55
|
+
/** Content width to column count. @default DEFAULT_BOARD_COLUMN_BREAKPOINTS */
|
|
56
|
+
columnBreakpoints?: ReadonlyArray<BoardColumnBreakpoint>;
|
|
57
|
+
/** An extra class on each item's surface; a function gets the item. */
|
|
58
|
+
itemClassName?: string | ((item: BoardItem<D>) => string | undefined);
|
|
59
|
+
/** Glyph of the drag handle. @default a grip */
|
|
60
|
+
dragHandleIcon?: ReactNode;
|
|
61
|
+
/** Glyph of the resize handle. @default a corner grip */
|
|
62
|
+
resizeHandleIcon?: ReactNode;
|
|
63
|
+
/** Accessible name of the drag handle. Default: the catalog's `uic.Board.dragHandle` */
|
|
64
|
+
dragHandleLabel?: string;
|
|
65
|
+
/** Accessible name of the resize handle. Default: the catalog's `uic.Board.resizeHandle` */
|
|
66
|
+
resizeHandleLabel?: string;
|
|
67
|
+
/** Announced when a move or resize starts. Default: `uic.Board.moveStarted` / `resizeStarted` */
|
|
68
|
+
liveAnnouncementDndStarted?: (operation: BoardOperation) => string;
|
|
69
|
+
/** Announced at each step of a move. Default: `uic.Board.itemMoved` */
|
|
70
|
+
liveAnnouncementDndItemMoved?: (detail: BoardDndDetail<D>) => string;
|
|
71
|
+
/** Announced at each step of a resize. Default: `uic.Board.itemResized` */
|
|
72
|
+
liveAnnouncementDndItemResized?: (detail: BoardDndDetail<D>) => string;
|
|
73
|
+
/** Announced when a move or resize is committed. Default: `uic.Board.moveCommitted` / `resizeCommitted` */
|
|
74
|
+
liveAnnouncementDndCommitted?: (operation: BoardOperation) => string;
|
|
75
|
+
/** Announced when a move or resize is discarded. Default: `uic.Board.moveDiscarded` / `resizeDiscarded` */
|
|
76
|
+
liveAnnouncementDndDiscarded?: (operation: BoardOperation) => string;
|
|
77
|
+
/** Announced when an item is removed. Default: `uic.Board.itemRemoved` */
|
|
78
|
+
liveAnnouncementItemRemoved?: (detail: BoardItemRemovedDetail<D>) => string;
|
|
79
|
+
}
|
|
80
|
+
export interface BoardMetrics {
|
|
81
|
+
cellWidth: number;
|
|
82
|
+
cellHeight: number;
|
|
83
|
+
gap: number;
|
|
84
|
+
}
|
|
85
|
+
interface Box {
|
|
86
|
+
left: number;
|
|
87
|
+
top: number;
|
|
88
|
+
right: number;
|
|
89
|
+
bottom: number;
|
|
90
|
+
}
|
|
91
|
+
export declare function columnsForWidth(width: number, breakpoints: ReadonlyArray<BoardColumnBreakpoint>): number;
|
|
92
|
+
/**
|
|
93
|
+
* The cells a box covers, in grid units: each edge of the box snaps to the
|
|
94
|
+
* nearest edge among the cells it touches, and the cells inside the snapped
|
|
95
|
+
* bounds are hovered. Null when the box touches no cell.
|
|
96
|
+
*/
|
|
97
|
+
export declare function hoveredCells(box: Box, columns: number, rows: number, metrics: BoardMetrics): Rect | null;
|
|
98
|
+
export declare function Board<D = unknown>({ items, renderItem, onItemsChange, isMovable, isResizable, variant, emptyContent, columnBreakpoints, itemClassName, dragHandleIcon, resizeHandleIcon, dragHandleLabel, resizeHandleLabel, liveAnnouncementDndStarted, liveAnnouncementDndItemMoved, liveAnnouncementDndItemResized, liveAnnouncementDndCommitted, liveAnnouncementDndDiscarded, liveAnnouncementItemRemoved, className, ...divProps }: BoardProps<D>): ReactNode;
|
|
99
|
+
export declare namespace Board {
|
|
100
|
+
var displayName: string;
|
|
101
|
+
}
|
|
102
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export declare const boardMessages: {
|
|
2
|
+
readonly "uic.Board.dragHandle": {
|
|
3
|
+
readonly defaultMessage: "Drag handle";
|
|
4
|
+
readonly description: "Accessible name of the button at a board item's top-left corner that moves the item";
|
|
5
|
+
};
|
|
6
|
+
readonly "uic.Board.resizeHandle": {
|
|
7
|
+
readonly defaultMessage: "Resize handle";
|
|
8
|
+
readonly description: "Accessible name of the button at a board item's bottom-right corner that resizes the item";
|
|
9
|
+
};
|
|
10
|
+
readonly "uic.Board.moveStarted": {
|
|
11
|
+
readonly defaultMessage: "Dragging.";
|
|
12
|
+
readonly description: "Screen reader announcement when a board item is picked up to be moved";
|
|
13
|
+
};
|
|
14
|
+
readonly "uic.Board.resizeStarted": {
|
|
15
|
+
readonly defaultMessage: "Resizing.";
|
|
16
|
+
readonly description: "Screen reader announcement when a board item starts being resized";
|
|
17
|
+
};
|
|
18
|
+
readonly "uic.Board.itemMoved": {
|
|
19
|
+
readonly defaultMessage: "Item moved to column {column}, row {row}.";
|
|
20
|
+
readonly description: "Screen reader announcement while a board item moves. {column} and {row} are 1-based";
|
|
21
|
+
};
|
|
22
|
+
readonly "uic.Board.itemResized": {
|
|
23
|
+
readonly defaultMessage: "Item resized to {columns} columns by {rows} rows.";
|
|
24
|
+
readonly description: "Screen reader announcement while a board item is resized";
|
|
25
|
+
};
|
|
26
|
+
readonly "uic.Board.moveCommitted": {
|
|
27
|
+
readonly defaultMessage: "Move committed.";
|
|
28
|
+
readonly description: "Screen reader announcement when a board item is dropped in its new place";
|
|
29
|
+
};
|
|
30
|
+
readonly "uic.Board.resizeCommitted": {
|
|
31
|
+
readonly defaultMessage: "Resize committed.";
|
|
32
|
+
readonly description: "Screen reader announcement when a board item's new size is applied";
|
|
33
|
+
};
|
|
34
|
+
readonly "uic.Board.moveDiscarded": {
|
|
35
|
+
readonly defaultMessage: "Move discarded.";
|
|
36
|
+
readonly description: "Screen reader announcement when moving a board item is cancelled";
|
|
37
|
+
};
|
|
38
|
+
readonly "uic.Board.resizeDiscarded": {
|
|
39
|
+
readonly defaultMessage: "Resize discarded.";
|
|
40
|
+
readonly description: "Screen reader announcement when resizing a board item is cancelled";
|
|
41
|
+
};
|
|
42
|
+
readonly "uic.Board.itemRemoved": {
|
|
43
|
+
readonly defaultMessage: "Item removed.";
|
|
44
|
+
readonly description: "Screen reader announcement when a board item is removed";
|
|
45
|
+
};
|
|
46
|
+
readonly "uic.Board.directionUp": {
|
|
47
|
+
readonly defaultMessage: "Up";
|
|
48
|
+
readonly description: "Accessible name of the button that moves an activated board item, or shrinks a resized one, one row up";
|
|
49
|
+
};
|
|
50
|
+
readonly "uic.Board.directionDown": {
|
|
51
|
+
readonly defaultMessage: "Down";
|
|
52
|
+
readonly description: "Accessible name of the button that moves an activated board item, or grows a resized one, one row down";
|
|
53
|
+
};
|
|
54
|
+
readonly "uic.Board.directionLeft": {
|
|
55
|
+
readonly defaultMessage: "Left";
|
|
56
|
+
readonly description: "Accessible name of the button that moves an activated board item, or shrinks a resized one, one column left";
|
|
57
|
+
};
|
|
58
|
+
readonly "uic.Board.directionRight": {
|
|
59
|
+
readonly defaultMessage: "Right";
|
|
60
|
+
readonly description: "Accessible name of the button that moves an activated board item, or grows a resized one, one column right";
|
|
61
|
+
};
|
|
62
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { defineMessages as e } from "../../i18n/catalog.js";
|
|
2
|
+
//#region src/components/Board/Board.messages.ts
|
|
3
|
+
var t = e({
|
|
4
|
+
"uic.Board.dragHandle": {
|
|
5
|
+
defaultMessage: "Drag handle",
|
|
6
|
+
description: "Accessible name of the button at a board item's top-left corner that moves the item"
|
|
7
|
+
},
|
|
8
|
+
"uic.Board.resizeHandle": {
|
|
9
|
+
defaultMessage: "Resize handle",
|
|
10
|
+
description: "Accessible name of the button at a board item's bottom-right corner that resizes the item"
|
|
11
|
+
},
|
|
12
|
+
"uic.Board.moveStarted": {
|
|
13
|
+
defaultMessage: "Dragging.",
|
|
14
|
+
description: "Screen reader announcement when a board item is picked up to be moved"
|
|
15
|
+
},
|
|
16
|
+
"uic.Board.resizeStarted": {
|
|
17
|
+
defaultMessage: "Resizing.",
|
|
18
|
+
description: "Screen reader announcement when a board item starts being resized"
|
|
19
|
+
},
|
|
20
|
+
"uic.Board.itemMoved": {
|
|
21
|
+
defaultMessage: "Item moved to column {column}, row {row}.",
|
|
22
|
+
description: "Screen reader announcement while a board item moves. {column} and {row} are 1-based"
|
|
23
|
+
},
|
|
24
|
+
"uic.Board.itemResized": {
|
|
25
|
+
defaultMessage: "Item resized to {columns} columns by {rows} rows.",
|
|
26
|
+
description: "Screen reader announcement while a board item is resized"
|
|
27
|
+
},
|
|
28
|
+
"uic.Board.moveCommitted": {
|
|
29
|
+
defaultMessage: "Move committed.",
|
|
30
|
+
description: "Screen reader announcement when a board item is dropped in its new place"
|
|
31
|
+
},
|
|
32
|
+
"uic.Board.resizeCommitted": {
|
|
33
|
+
defaultMessage: "Resize committed.",
|
|
34
|
+
description: "Screen reader announcement when a board item's new size is applied"
|
|
35
|
+
},
|
|
36
|
+
"uic.Board.moveDiscarded": {
|
|
37
|
+
defaultMessage: "Move discarded.",
|
|
38
|
+
description: "Screen reader announcement when moving a board item is cancelled"
|
|
39
|
+
},
|
|
40
|
+
"uic.Board.resizeDiscarded": {
|
|
41
|
+
defaultMessage: "Resize discarded.",
|
|
42
|
+
description: "Screen reader announcement when resizing a board item is cancelled"
|
|
43
|
+
},
|
|
44
|
+
"uic.Board.itemRemoved": {
|
|
45
|
+
defaultMessage: "Item removed.",
|
|
46
|
+
description: "Screen reader announcement when a board item is removed"
|
|
47
|
+
},
|
|
48
|
+
"uic.Board.directionUp": {
|
|
49
|
+
defaultMessage: "Up",
|
|
50
|
+
description: "Accessible name of the button that moves an activated board item, or shrinks a resized one, one row up"
|
|
51
|
+
},
|
|
52
|
+
"uic.Board.directionDown": {
|
|
53
|
+
defaultMessage: "Down",
|
|
54
|
+
description: "Accessible name of the button that moves an activated board item, or grows a resized one, one row down"
|
|
55
|
+
},
|
|
56
|
+
"uic.Board.directionLeft": {
|
|
57
|
+
defaultMessage: "Left",
|
|
58
|
+
description: "Accessible name of the button that moves an activated board item, or shrinks a resized one, one column left"
|
|
59
|
+
},
|
|
60
|
+
"uic.Board.directionRight": {
|
|
61
|
+
defaultMessage: "Right",
|
|
62
|
+
description: "Accessible name of the button that moves an activated board item, or grows a resized one, one column right"
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
//#endregion
|
|
66
|
+
export { t as boardMessages };
|
|
67
|
+
|
|
68
|
+
//# sourceMappingURL=Board.messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Board.messages.js","names":[],"sources":["../../../src/components/Board/Board.messages.ts"],"sourcesContent":["import { defineMessages } from \"../../i18n/catalog\";\n\nexport const boardMessages = defineMessages({\n \"uic.Board.dragHandle\": {\n defaultMessage: \"Drag handle\",\n description:\n \"Accessible name of the button at a board item's top-left corner that moves the item\",\n },\n \"uic.Board.resizeHandle\": {\n defaultMessage: \"Resize handle\",\n description:\n \"Accessible name of the button at a board item's bottom-right corner that resizes the item\",\n },\n \"uic.Board.moveStarted\": {\n defaultMessage: \"Dragging.\",\n description:\n \"Screen reader announcement when a board item is picked up to be moved\",\n },\n \"uic.Board.resizeStarted\": {\n defaultMessage: \"Resizing.\",\n description: \"Screen reader announcement when a board item starts being resized\",\n },\n \"uic.Board.itemMoved\": {\n defaultMessage: \"Item moved to column {column}, row {row}.\",\n description:\n \"Screen reader announcement while a board item moves. {column} and {row} are 1-based\",\n },\n \"uic.Board.itemResized\": {\n defaultMessage: \"Item resized to {columns} columns by {rows} rows.\",\n description: \"Screen reader announcement while a board item is resized\",\n },\n \"uic.Board.moveCommitted\": {\n defaultMessage: \"Move committed.\",\n description:\n \"Screen reader announcement when a board item is dropped in its new place\",\n },\n \"uic.Board.resizeCommitted\": {\n defaultMessage: \"Resize committed.\",\n description: \"Screen reader announcement when a board item's new size is applied\",\n },\n \"uic.Board.moveDiscarded\": {\n defaultMessage: \"Move discarded.\",\n description: \"Screen reader announcement when moving a board item is cancelled\",\n },\n \"uic.Board.resizeDiscarded\": {\n defaultMessage: \"Resize discarded.\",\n description: \"Screen reader announcement when resizing a board item is cancelled\",\n },\n \"uic.Board.itemRemoved\": {\n defaultMessage: \"Item removed.\",\n description: \"Screen reader announcement when a board item is removed\",\n },\n \"uic.Board.directionUp\": {\n defaultMessage: \"Up\",\n description:\n \"Accessible name of the button that moves an activated board item, or shrinks a resized one, one row up\",\n },\n \"uic.Board.directionDown\": {\n defaultMessage: \"Down\",\n description:\n \"Accessible name of the button that moves an activated board item, or grows a resized one, one row down\",\n },\n \"uic.Board.directionLeft\": {\n defaultMessage: \"Left\",\n description:\n \"Accessible name of the button that moves an activated board item, or shrinks a resized one, one column left\",\n },\n \"uic.Board.directionRight\": {\n defaultMessage: \"Right\",\n description:\n \"Accessible name of the button that moves an activated board item, or grows a resized one, one column right\",\n },\n});\n"],"mappings":";;AAEA,IAAa,IAAgB,EAAe;CAC1C,wBAAwB;EACtB,gBAAgB;EAChB,aACE;CACJ;CACA,0BAA0B;EACxB,gBAAgB;EAChB,aACE;CACJ;CACA,yBAAyB;EACvB,gBAAgB;EAChB,aACE;CACJ;CACA,2BAA2B;EACzB,gBAAgB;EAChB,aAAa;CACf;CACA,uBAAuB;EACrB,gBAAgB;EAChB,aACE;CACJ;CACA,yBAAyB;EACvB,gBAAgB;EAChB,aAAa;CACf;CACA,2BAA2B;EACzB,gBAAgB;EAChB,aACE;CACJ;CACA,6BAA6B;EAC3B,gBAAgB;EAChB,aAAa;CACf;CACA,2BAA2B;EACzB,gBAAgB;EAChB,aAAa;CACf;CACA,6BAA6B;EAC3B,gBAAgB;EAChB,aAAa;CACf;CACA,yBAAyB;EACvB,gBAAgB;EAChB,aAAa;CACf;CACA,yBAAyB;EACvB,gBAAgB;EAChB,aACE;CACJ;CACA,2BAA2B;EACzB,gBAAgB;EAChB,aACE;CACJ;CACA,2BAA2B;EACzB,gBAAgB;EAChB,aACE;CACJ;CACA,4BAA4B;EAC1B,gBAAgB;EAChB,aACE;CACJ;AACF,CAAC"}
|