@grampro/kit 0.0.0-stage → 2.4.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/.gbs/skills/gbs-components/SKILL.md +190 -0
- package/.gbs/skills/gbs-components/references/accessibility.md +102 -0
- package/.gbs/skills/gbs-components/references/data-display.md +185 -0
- package/.gbs/skills/gbs-components/references/data-grid.md +116 -0
- package/.gbs/skills/gbs-components/references/forms.md +202 -0
- package/.gbs/skills/gbs-components/references/install.md +211 -0
- package/.gbs/skills/gbs-components/references/overlays.md +206 -0
- package/.gbs/skills/gbs-components/references/pickers.md +83 -0
- package/.gbs/skills/gbs-components/references/styling.md +246 -0
- package/.gbs/skills/gbs-components/references/toaster.md +57 -0
- package/CHANGELOG.md +173 -0
- package/LICENSE +15 -0
- package/README.md +193 -2
- package/index.cjs +1410 -0
- package/package.json +77 -6
- package/schema/passport-v1.schema.json +204 -0
- package/source/components/accordion/README.md +45 -0
- package/source/components/accordion/core/index.ts +2 -0
- package/source/components/accordion/core/open.ts +56 -0
- package/source/components/accordion/core/types.ts +17 -0
- package/source/components/accordion/index.ts +8 -0
- package/source/components/accordion/passport.json +259 -0
- package/source/components/accordion/react/Accordion.tsx +133 -0
- package/source/components/accordion/react/AccordionItem.tsx +120 -0
- package/source/components/accordion/react/context.ts +20 -0
- package/source/components/accordion/react/props.ts +13 -0
- package/source/components/accordion/styles.css +207 -0
- package/source/components/alert/README.md +39 -0
- package/source/components/alert/core/index.ts +2 -0
- package/source/components/alert/core/live.ts +25 -0
- package/source/components/alert/core/types.ts +7 -0
- package/source/components/alert/index.ts +5 -0
- package/source/components/alert/passport.json +250 -0
- package/source/components/alert/react/Alert.tsx +113 -0
- package/source/components/alert/react/icons.tsx +21 -0
- package/source/components/alert/react/locale.ts +5 -0
- package/source/components/alert/react/props.ts +11 -0
- package/source/components/alert/styles.css +154 -0
- package/source/components/avatar/core/identity.ts +103 -0
- package/source/components/avatar/core/index.ts +2 -0
- package/source/components/avatar/core/types.ts +12 -0
- package/source/components/avatar/index.ts +7 -0
- package/source/components/avatar/passport.json +294 -0
- package/source/components/avatar/react/Avatar.tsx +118 -0
- package/source/components/avatar/react/AvatarGroup.tsx +74 -0
- package/source/components/avatar/react/locale.ts +11 -0
- package/source/components/avatar/react/props.ts +6 -0
- package/source/components/avatar/styles.css +225 -0
- package/source/components/badge/README.md +37 -0
- package/source/components/badge/core/count.ts +37 -0
- package/source/components/badge/core/index.ts +2 -0
- package/source/components/badge/core/types.ts +11 -0
- package/source/components/badge/index.ts +7 -0
- package/source/components/badge/passport.json +332 -0
- package/source/components/badge/react/Badge.tsx +89 -0
- package/source/components/badge/react/Tag.tsx +82 -0
- package/source/components/badge/react/locale.ts +5 -0
- package/source/components/badge/react/props.ts +6 -0
- package/source/components/badge/styles.css +203 -0
- package/source/components/breadcrumb/README.md +34 -0
- package/source/components/breadcrumb/core/index.ts +4 -0
- package/source/components/breadcrumb/core/trail.ts +42 -0
- package/source/components/breadcrumb/core/types.ts +20 -0
- package/source/components/breadcrumb/index.ts +5 -0
- package/source/components/breadcrumb/passport.json +243 -0
- package/source/components/breadcrumb/react/Breadcrumb.tsx +177 -0
- package/source/components/breadcrumb/react/locale.ts +6 -0
- package/source/components/breadcrumb/react/props.ts +14 -0
- package/source/components/breadcrumb/styles.css +138 -0
- package/source/components/button/README.md +32 -0
- package/source/components/button/core/index.ts +3 -0
- package/source/components/button/core/state.ts +16 -0
- package/source/components/button/core/types.ts +28 -0
- package/source/components/button/index.ts +5 -0
- package/source/components/button/passport.json +402 -0
- package/source/components/button/passport.manual.json +31 -0
- package/source/components/button/react/Button.tsx +173 -0
- package/source/components/button/react/locale.ts +5 -0
- package/source/components/button/react/props.ts +23 -0
- package/source/components/button/styles.css +232 -0
- package/source/components/card/README.md +60 -0
- package/source/components/card/core/index.ts +4 -0
- package/source/components/card/core/trend.ts +32 -0
- package/source/components/card/core/types.ts +5 -0
- package/source/components/card/index.ts +5 -0
- package/source/components/card/passport.json +337 -0
- package/source/components/card/react/Card.tsx +133 -0
- package/source/components/card/react/Stat.tsx +127 -0
- package/source/components/card/react/props.ts +4 -0
- package/source/components/card/styles.css +230 -0
- package/source/components/checkbox/README.md +36 -0
- package/source/components/checkbox/core/group.ts +30 -0
- package/source/components/checkbox/core/index.ts +3 -0
- package/source/components/checkbox/core/types.ts +17 -0
- package/source/components/checkbox/index.ts +9 -0
- package/source/components/checkbox/passport.json +456 -0
- package/source/components/checkbox/react/Checkbox.tsx +147 -0
- package/source/components/checkbox/react/CheckboxGroup.tsx +149 -0
- package/source/components/checkbox/react/context.ts +16 -0
- package/source/components/checkbox/react/locale.ts +5 -0
- package/source/components/checkbox/react/props.ts +6 -0
- package/source/components/checkbox/styles.css +211 -0
- package/source/components/combobox/README.md +170 -0
- package/source/components/combobox/core/filter.ts +155 -0
- package/source/components/combobox/core/index.ts +16 -0
- package/source/components/combobox/core/types.ts +48 -0
- package/source/components/combobox/core/virtual.ts +67 -0
- package/source/components/combobox/index.ts +13 -0
- package/source/components/combobox/passport.json +456 -0
- package/source/components/combobox/react/Listbox.tsx +310 -0
- package/source/components/combobox/react/MultiSelect.tsx +265 -0
- package/source/components/combobox/react/Popover.tsx +38 -0
- package/source/components/combobox/react/Select.tsx +200 -0
- package/source/components/combobox/react/icons.tsx +11 -0
- package/source/components/combobox/react/locale.ts +16 -0
- package/source/components/combobox/react/props.ts +88 -0
- package/source/components/combobox/react/useCombobox.ts +409 -0
- package/source/components/combobox/styles.css +419 -0
- package/source/components/data-grid/README.md +233 -0
- package/source/components/data-grid/agent/coerce.ts +368 -0
- package/source/components/data-grid/agent/contract.ts +410 -0
- package/source/components/data-grid/agent/dataset.ts +92 -0
- package/source/components/data-grid/agent/engine.ts +470 -0
- package/source/components/data-grid/agent/executors.ts +155 -0
- package/source/components/data-grid/agent/index.ts +79 -0
- package/source/components/data-grid/agent/intent.ts +324 -0
- package/source/components/data-grid/agent/operations.ts +335 -0
- package/source/components/data-grid/agent/validate.ts +630 -0
- package/source/components/data-grid/agent/webmcp.ts +107 -0
- package/source/components/data-grid/core/columnHelper.ts +21 -0
- package/source/components/data-grid/core/columns.ts +288 -0
- package/source/components/data-grid/core/filtering.ts +237 -0
- package/source/components/data-grid/core/grid.ts +638 -0
- package/source/components/data-grid/core/index.ts +14 -0
- package/source/components/data-grid/core/rows.ts +64 -0
- package/source/components/data-grid/core/sorting.ts +133 -0
- package/source/components/data-grid/core/state.ts +82 -0
- package/source/components/data-grid/core/store.ts +52 -0
- package/source/components/data-grid/core/types.ts +302 -0
- package/source/components/data-grid/core/values.ts +98 -0
- package/source/components/data-grid/core/virtual.ts +85 -0
- package/source/components/data-grid/export/csv.ts +32 -0
- package/source/components/data-grid/export/download.ts +12 -0
- package/source/components/data-grid/export/pdf-font.ts +139 -0
- package/source/components/data-grid/export/pdf-writer.ts +113 -0
- package/source/components/data-grid/export/pdf.ts +379 -0
- package/source/components/data-grid/export/table.ts +73 -0
- package/source/components/data-grid/export/xlsx.ts +145 -0
- package/source/components/data-grid/export/zip.ts +87 -0
- package/source/components/data-grid/index.ts +14 -0
- package/source/components/data-grid/passport.json +1051 -0
- package/source/components/data-grid/passport.manual.json +255 -0
- package/source/components/data-grid/react/AskGrid.tsx +164 -0
- package/source/components/data-grid/react/Cell.tsx +282 -0
- package/source/components/data-grid/react/ColumnMenu.tsx +135 -0
- package/source/components/data-grid/react/DataGrid.tsx +335 -0
- package/source/components/data-grid/react/FilterForm.tsx +142 -0
- package/source/components/data-grid/react/HeaderRow.tsx +332 -0
- package/source/components/data-grid/react/Pagination.tsx +107 -0
- package/source/components/data-grid/react/Popover.tsx +35 -0
- package/source/components/data-grid/react/Row.tsx +85 -0
- package/source/components/data-grid/react/Toolbar.tsx +267 -0
- package/source/components/data-grid/react/Viewport.tsx +167 -0
- package/source/components/data-grid/react/context.ts +57 -0
- package/source/components/data-grid/react/hooks.ts +83 -0
- package/source/components/data-grid/react/icons.tsx +45 -0
- package/source/components/data-grid/react/keyboard.ts +110 -0
- package/source/components/data-grid/react/locale.ts +130 -0
- package/source/components/data-grid/styles.css +874 -0
- package/source/components/date-picker/README.md +141 -0
- package/source/components/date-picker/core/calendar.ts +266 -0
- package/source/components/date-picker/core/format.ts +170 -0
- package/source/components/date-picker/core/index.ts +41 -0
- package/source/components/date-picker/core/today.ts +72 -0
- package/source/components/date-picker/core/types.ts +68 -0
- package/source/components/date-picker/index.ts +16 -0
- package/source/components/date-picker/passport.json +407 -0
- package/source/components/date-picker/react/Calendar.tsx +160 -0
- package/source/components/date-picker/react/CalendarPanel.tsx +170 -0
- package/source/components/date-picker/react/DatePicker.tsx +249 -0
- package/source/components/date-picker/react/DateRangePicker.tsx +291 -0
- package/source/components/date-picker/react/MonthYearPanels.tsx +123 -0
- package/source/components/date-picker/react/Popover.tsx +45 -0
- package/source/components/date-picker/react/icons.tsx +15 -0
- package/source/components/date-picker/react/locale.ts +23 -0
- package/source/components/date-picker/react/props.ts +76 -0
- package/source/components/date-picker/react/useDatePicker.ts +557 -0
- package/source/components/date-picker/styles.css +445 -0
- package/source/components/dialog/README.md +39 -0
- package/source/components/dialog/core/api.ts +34 -0
- package/source/components/dialog/core/dialog.ts +11 -0
- package/source/components/dialog/core/index.ts +7 -0
- package/source/components/dialog/core/store.ts +81 -0
- package/source/components/dialog/core/types.ts +59 -0
- package/source/components/dialog/index.ts +7 -0
- package/source/components/dialog/passport.json +344 -0
- package/source/components/dialog/react/Dialog.tsx +279 -0
- package/source/components/dialog/react/DialogHost.tsx +45 -0
- package/source/components/dialog/react/icons.tsx +20 -0
- package/source/components/dialog/react/locale.ts +8 -0
- package/source/components/dialog/react/props.ts +13 -0
- package/source/components/dialog/styles.css +280 -0
- package/source/components/file-uploader/README.md +99 -0
- package/source/components/file-uploader/core/format.ts +79 -0
- package/source/components/file-uploader/core/index.ts +26 -0
- package/source/components/file-uploader/core/store.ts +432 -0
- package/source/components/file-uploader/core/transport.ts +154 -0
- package/source/components/file-uploader/core/types.ts +126 -0
- package/source/components/file-uploader/core/validate.ts +83 -0
- package/source/components/file-uploader/index.ts +7 -0
- package/source/components/file-uploader/passport.json +518 -0
- package/source/components/file-uploader/react/FileRow.tsx +268 -0
- package/source/components/file-uploader/react/FileUploader.tsx +511 -0
- package/source/components/file-uploader/react/icons.tsx +60 -0
- package/source/components/file-uploader/react/locale.ts +33 -0
- package/source/components/file-uploader/react/props.ts +31 -0
- package/source/components/file-uploader/react/useFileUploader.ts +32 -0
- package/source/components/file-uploader/styles.css +394 -0
- package/source/components/input/README.md +44 -0
- package/source/components/input/core/count.ts +5 -0
- package/source/components/input/core/index.ts +11 -0
- package/source/components/input/core/otp.ts +64 -0
- package/source/components/input/core/types.ts +14 -0
- package/source/components/input/index.ts +8 -0
- package/source/components/input/passport.json +536 -0
- package/source/components/input/react/Input.tsx +219 -0
- package/source/components/input/react/OtpInput.tsx +256 -0
- package/source/components/input/react/dom.ts +10 -0
- package/source/components/input/react/icons.tsx +17 -0
- package/source/components/input/react/locale.ts +9 -0
- package/source/components/input/react/props.ts +6 -0
- package/source/components/input/styles.css +295 -0
- package/source/components/menu/README.md +68 -0
- package/source/components/menu/core/index.ts +11 -0
- package/source/components/menu/core/navigation.ts +84 -0
- package/source/components/menu/core/types.ts +32 -0
- package/source/components/menu/index.ts +19 -0
- package/source/components/menu/passport.json +322 -0
- package/source/components/menu/react/Menu.tsx +371 -0
- package/source/components/menu/react/context.ts +31 -0
- package/source/components/menu/react/items.tsx +268 -0
- package/source/components/menu/react/locale.ts +6 -0
- package/source/components/menu/react/props.ts +4 -0
- package/source/components/menu/react/useMenuKeys.ts +124 -0
- package/source/components/menu/styles.css +224 -0
- package/source/components/modal/README.md +51 -0
- package/source/components/modal/core/dismiss.ts +29 -0
- package/source/components/modal/core/index.ts +3 -0
- package/source/components/modal/core/types.ts +27 -0
- package/source/components/modal/index.ts +5 -0
- package/source/components/modal/passport.json +289 -0
- package/source/components/modal/react/Modal.tsx +242 -0
- package/source/components/modal/react/icons.tsx +1 -0
- package/source/components/modal/react/locale.ts +5 -0
- package/source/components/modal/react/props.ts +17 -0
- package/source/components/modal/styles.css +241 -0
- package/source/components/number-input/README.md +53 -0
- package/source/components/number-input/core/format.ts +37 -0
- package/source/components/number-input/core/index.ts +4 -0
- package/source/components/number-input/core/parse.ts +118 -0
- package/source/components/number-input/core/step.ts +73 -0
- package/source/components/number-input/core/types.ts +32 -0
- package/source/components/number-input/index.ts +5 -0
- package/source/components/number-input/passport.json +541 -0
- package/source/components/number-input/react/NumberInput.tsx +465 -0
- package/source/components/number-input/react/icons.tsx +17 -0
- package/source/components/number-input/react/locale.ts +7 -0
- package/source/components/number-input/react/props.ts +11 -0
- package/source/components/number-input/styles.css +230 -0
- package/source/components/popover/README.md +44 -0
- package/source/components/popover/core/index.ts +2 -0
- package/source/components/popover/core/types.ts +12 -0
- package/source/components/popover/index.ts +4 -0
- package/source/components/popover/passport.json +238 -0
- package/source/components/popover/react/Popover.tsx +202 -0
- package/source/components/popover/react/locale.ts +5 -0
- package/source/components/popover/react/props.ts +4 -0
- package/source/components/popover/styles.css +148 -0
- package/source/components/progress/README.md +38 -0
- package/source/components/progress/core/index.ts +2 -0
- package/source/components/progress/core/progress.ts +40 -0
- package/source/components/progress/core/types.ts +23 -0
- package/source/components/progress/index.ts +7 -0
- package/source/components/progress/passport.json +270 -0
- package/source/components/progress/react/CircularProgress.tsx +106 -0
- package/source/components/progress/react/Progress.tsx +113 -0
- package/source/components/progress/react/locale.ts +7 -0
- package/source/components/progress/react/props.ts +6 -0
- package/source/components/progress/styles.css +200 -0
- package/source/components/radio-group/README.md +58 -0
- package/source/components/radio-group/core/group.ts +36 -0
- package/source/components/radio-group/core/index.ts +2 -0
- package/source/components/radio-group/core/types.ts +20 -0
- package/source/components/radio-group/index.ts +9 -0
- package/source/components/radio-group/passport.json +477 -0
- package/source/components/radio-group/react/Radio.tsx +144 -0
- package/source/components/radio-group/react/RadioGroup.tsx +179 -0
- package/source/components/radio-group/react/context.ts +18 -0
- package/source/components/radio-group/react/locale.ts +5 -0
- package/source/components/radio-group/react/props.ts +12 -0
- package/source/components/radio-group/styles.css +269 -0
- package/source/components/shared/README.md +54 -0
- package/source/components/shared/core/agent/adapter.ts +65 -0
- package/source/components/shared/core/agent/history.ts +120 -0
- package/source/components/shared/core/agent/index.ts +46 -0
- package/source/components/shared/core/agent/numbers.ts +217 -0
- package/source/components/shared/core/agent/schema.ts +180 -0
- package/source/components/shared/core/agent/types.ts +169 -0
- package/source/components/shared/core/agent/webmcp.ts +328 -0
- package/source/components/shared/core/cx.ts +9 -0
- package/source/components/shared/core/field.ts +35 -0
- package/source/components/shared/core/position.ts +124 -0
- package/source/components/shared/core/text.ts +14 -0
- package/source/components/shared/index.ts +17 -0
- package/source/components/shared/react/GramproAIProvider.tsx +50 -0
- package/source/components/shared/react/Popover.tsx +189 -0
- package/source/components/shared/react/icons.tsx +74 -0
- package/source/components/shared/react/useAskAgent.ts +217 -0
- package/source/components/shared/react/useControllableState.ts +42 -0
- package/source/components/shared/styles.css +79 -0
- package/source/components/shared/version.json +4 -0
- package/source/components/shared/version.ts +6 -0
- package/source/components/skeleton/README.md +58 -0
- package/source/components/skeleton/core/index.ts +3 -0
- package/source/components/skeleton/core/lines.ts +25 -0
- package/source/components/skeleton/core/types.ts +5 -0
- package/source/components/skeleton/index.ts +5 -0
- package/source/components/skeleton/passport.json +251 -0
- package/source/components/skeleton/react/Empty.tsx +51 -0
- package/source/components/skeleton/react/Skeleton.tsx +92 -0
- package/source/components/skeleton/react/props.ts +4 -0
- package/source/components/skeleton/styles.css +185 -0
- package/source/components/spinner/README.md +29 -0
- package/source/components/spinner/core/index.ts +3 -0
- package/source/components/spinner/core/types.ts +28 -0
- package/source/components/spinner/core/visibility.ts +34 -0
- package/source/components/spinner/index.ts +6 -0
- package/source/components/spinner/passport.json +245 -0
- package/source/components/spinner/react/Spinner.tsx +96 -0
- package/source/components/spinner/react/locale.ts +5 -0
- package/source/components/spinner/react/props.ts +4 -0
- package/source/components/spinner/react/useDelayedLoading.ts +39 -0
- package/source/components/spinner/styles.css +173 -0
- package/source/components/switch/README.md +46 -0
- package/source/components/switch/core/index.ts +2 -0
- package/source/components/switch/core/toggle.ts +54 -0
- package/source/components/switch/core/types.ts +9 -0
- package/source/components/switch/index.ts +5 -0
- package/source/components/switch/passport.json +421 -0
- package/source/components/switch/react/Switch.tsx +219 -0
- package/source/components/switch/react/locale.ts +5 -0
- package/source/components/switch/react/props.ts +12 -0
- package/source/components/switch/styles.css +227 -0
- package/source/components/tabs/README.md +32 -0
- package/source/components/tabs/core/index.ts +3 -0
- package/source/components/tabs/core/navigation.ts +54 -0
- package/source/components/tabs/core/types.ts +16 -0
- package/source/components/tabs/index.ts +5 -0
- package/source/components/tabs/passport.json +315 -0
- package/source/components/tabs/react/Tabs.tsx +306 -0
- package/source/components/tabs/react/context.ts +21 -0
- package/source/components/tabs/styles.css +263 -0
- package/source/components/textarea/README.md +39 -0
- package/source/components/textarea/core/count.ts +5 -0
- package/source/components/textarea/core/index.ts +4 -0
- package/source/components/textarea/core/size.ts +23 -0
- package/source/components/textarea/core/types.ts +17 -0
- package/source/components/textarea/index.ts +5 -0
- package/source/components/textarea/passport.json +382 -0
- package/source/components/textarea/react/Textarea.tsx +208 -0
- package/source/components/textarea/react/locale.ts +5 -0
- package/source/components/textarea/react/props.ts +4 -0
- package/source/components/textarea/styles.css +158 -0
- package/source/components/toaster/README.md +128 -0
- package/source/components/toaster/core/api.ts +87 -0
- package/source/components/toaster/core/index.ts +14 -0
- package/source/components/toaster/core/store.ts +211 -0
- package/source/components/toaster/core/toast.ts +12 -0
- package/source/components/toaster/core/types.ts +78 -0
- package/source/components/toaster/index.ts +6 -0
- package/source/components/toaster/passport.json +221 -0
- package/source/components/toaster/react/ToastItem.tsx +164 -0
- package/source/components/toaster/react/Toaster.tsx +187 -0
- package/source/components/toaster/react/icons.tsx +23 -0
- package/source/components/toaster/react/locale.ts +6 -0
- package/source/components/toaster/react/props.ts +15 -0
- package/source/components/toaster/react/useToasts.ts +11 -0
- package/source/components/toaster/styles.css +282 -0
- package/source/components/tooltip/README.md +43 -0
- package/source/components/tooltip/core/index.ts +4 -0
- package/source/components/tooltip/core/types.ts +4 -0
- package/source/components/tooltip/core/visibility.ts +34 -0
- package/source/components/tooltip/index.ts +3 -0
- package/source/components/tooltip/passport.json +170 -0
- package/source/components/tooltip/react/Tooltip.tsx +196 -0
- package/source/components/tooltip/react/props.ts +4 -0
- package/source/components/tooltip/styles.css +71 -0
- package/source/fallback/index.tsx +11 -0
- package/source/globalStyle.ts +74 -0
- package/source/hooks/SelectionHooks/type.ts +4 -0
- package/source/hooks/SelectionHooks/useClickOutside.ts +22 -0
- package/source/hooks/SelectionHooks/useMultiSelectState.ts +64 -0
- package/source/hooks/SelectionHooks/useSelectData.ts +58 -0
- package/source/hooks/SelectionHooks/useSelectState.ts +36 -0
- package/source/icon/Icon.tsx +102 -0
- package/source/icon/iconPaths.ts +206 -0
- package/source/legacy-components/bargraph/index.tsx +95 -0
- package/source/legacy-components/bargraph/type.ts +12 -0
- package/source/legacy-components/breadcrumb/index.tsx +66 -0
- package/source/legacy-components/breadcrumb/types.ts +10 -0
- package/source/legacy-components/button/index.tsx +42 -0
- package/source/legacy-components/card/index.tsx +31 -0
- package/source/legacy-components/checkbox/index.tsx +25 -0
- package/source/legacy-components/contextmenu/ContextMenu.tsx +87 -0
- package/source/legacy-components/contextmenu/ContextMenuItem.tsx +30 -0
- package/source/legacy-components/contextmenu/index.ts +2 -0
- package/source/legacy-components/contextmenu/types.ts +19 -0
- package/source/legacy-components/darkmode/index.tsx +55 -0
- package/source/legacy-components/datagrid/context/GridContext.tsx +215 -0
- package/source/legacy-components/datagrid/createTemplate.tsx +82 -0
- package/source/legacy-components/datagrid/hooks/index.ts +6 -0
- package/source/legacy-components/datagrid/hooks/useColumns.ts +33 -0
- package/source/legacy-components/datagrid/hooks/useDataSource.ts +54 -0
- package/source/legacy-components/datagrid/hooks/useFiltering.ts +169 -0
- package/source/legacy-components/datagrid/hooks/usePagination.ts +112 -0
- package/source/legacy-components/datagrid/hooks/useRowSelection.ts +48 -0
- package/source/legacy-components/datagrid/hooks/useSearch.ts +90 -0
- package/source/legacy-components/datagrid/index.tsx +28 -0
- package/source/legacy-components/datagrid/layout/FilterPopup.tsx +92 -0
- package/source/legacy-components/datagrid/layout/GridBody.tsx +184 -0
- package/source/legacy-components/datagrid/layout/GridPagination.tsx +119 -0
- package/source/legacy-components/datagrid/layout/GridToolbar.tsx +109 -0
- package/source/legacy-components/datagrid/layout/index.tsx +68 -0
- package/source/legacy-components/datagrid/type.ts +198 -0
- package/source/legacy-components/datepicker/index.tsx +365 -0
- package/source/legacy-components/datepicker/types.ts +12 -0
- package/source/legacy-components/dialog/index.tsx +44 -0
- package/source/legacy-components/dialog/types.ts +12 -0
- package/source/legacy-components/formrenderer/componentHandles/CheckBoxHandles.tsx +80 -0
- package/source/legacy-components/formrenderer/componentHandles/DatePickerHandles.tsx +93 -0
- package/source/legacy-components/formrenderer/componentHandles/InputHandles.tsx +106 -0
- package/source/legacy-components/formrenderer/componentHandles/MultiHandles.tsx +93 -0
- package/source/legacy-components/formrenderer/componentHandles/SelectHandles.tsx +95 -0
- package/source/legacy-components/formrenderer/helperFunctions.ts +72 -0
- package/source/legacy-components/formrenderer/index.tsx +93 -0
- package/source/legacy-components/formrenderer/types.ts +127 -0
- package/source/legacy-components/input/index.tsx +142 -0
- package/source/legacy-components/input/types.ts +10 -0
- package/source/legacy-components/materialInput/index.tsx +138 -0
- package/source/legacy-components/materialInput/types.ts +16 -0
- package/source/legacy-components/modal/index.tsx +152 -0
- package/source/legacy-components/modal/types.ts +19 -0
- package/source/legacy-components/multiselect/PortalDropDown.tsx +44 -0
- package/source/legacy-components/multiselect/index.tsx +269 -0
- package/source/legacy-components/multiselect/types.ts +26 -0
- package/source/legacy-components/navbar/AuthSection.tsx +98 -0
- package/source/legacy-components/navbar/MobileToggle.tsx +31 -0
- package/source/legacy-components/navbar/NavItemComponent.tsx +119 -0
- package/source/legacy-components/navbar/SearchBar.tsx +55 -0
- package/source/legacy-components/navbar/helperFunctions.ts +27 -0
- package/source/legacy-components/navbar/index.tsx +156 -0
- package/source/legacy-components/navbar/types.ts +69 -0
- package/source/legacy-components/select/PortalDropDown.tsx +59 -0
- package/source/legacy-components/select/index.tsx +249 -0
- package/source/legacy-components/select/types.ts +29 -0
- package/source/legacy-components/sidebar/components/MenuItem.tsx +101 -0
- package/source/legacy-components/sidebar/components/MenuSection.tsx +34 -0
- package/source/legacy-components/sidebar/components/SidebarFooter.tsx +50 -0
- package/source/legacy-components/sidebar/components/SidebarLogo.tsx +24 -0
- package/source/legacy-components/sidebar/components/SidebarMenu.tsx +29 -0
- package/source/legacy-components/sidebar/components/UserProfile.tsx +31 -0
- package/source/legacy-components/sidebar/hooks/useSidebarState.ts +41 -0
- package/source/legacy-components/sidebar/index.tsx +77 -0
- package/source/legacy-components/sidebar/type.ts +42 -0
- package/source/legacy-components/spinner/Stroke.tsx +89 -0
- package/source/legacy-components/spinner/index.tsx +54 -0
- package/source/legacy-components/spinner/types.ts +9 -0
- package/source/legacy-components/tabs/index.tsx +71 -0
- package/source/legacy-components/tabs/types.ts +16 -0
- package/source/legacy-components/textarea/index.tsx +123 -0
- package/source/legacy-components/textarea/types.ts +15 -0
- package/source/legacy-components/toast/ToastComponent.tsx +101 -0
- package/source/legacy-components/toast/ToastIcon.tsx +61 -0
- package/source/legacy-components/toast/index.tsx +42 -0
- package/source/legacy-components/toast/toastStore.ts +42 -0
- package/source/legacy-components/toast/types.ts +18 -0
- package/source/legacy-components/toast/useToast.ts +12 -0
- package/source/legacy-components/uploader/ProgressAnimation.tsx +50 -0
- package/source/legacy-components/uploader/UploadedFilePreview.tsx +130 -0
- package/source/legacy-components/uploader/index.tsx +311 -0
- package/source/legacy-components/uploader/types.ts +30 -0
- package/source/legacy-components/uploader/uploaderIcon.tsx +72 -0
- package/source/legacy-components/uploader/uploaderService.ts +134 -0
- package/source/legacy-components/useUploader/useUploader.tsx +310 -0
- package/source/legacy-components/usepaginateddata/usePaginatedData.ts +174 -0
- package/source/theme.ts +40 -0
- package/source/utils.ts +10 -0
- package/tools/env.cjs +61 -0
- package/tools/passport/cli.cjs +79 -0
- package/tools/passport/extract.cjs +493 -0
- package/tools/passport/index.cjs +185 -0
- package/tools/passport/merge.cjs +131 -0
- package/tools/passport/policy.cjs +65 -0
- package/tools/passport/validate.cjs +277 -0
- package/tools/ts-require.cjs +79 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Pickers
|
|
2
|
+
|
|
3
|
+
Select, MultiSelect, DatePicker, DateRangePicker and FileUploader. They share the
|
|
4
|
+
field contract in `forms.md` (`label`, `description`, `error`, `size`,
|
|
5
|
+
`classNames`, `localeText`) but all four use **`onChange`**, not `onValueChange`.
|
|
6
|
+
|
|
7
|
+
## Select and MultiSelect
|
|
8
|
+
|
|
9
|
+
Import both from `component-lib/combobox`.
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
interface ComboboxOption<V = string> {
|
|
13
|
+
value: V; // string or number
|
|
14
|
+
label: string;
|
|
15
|
+
description?: string; // second line
|
|
16
|
+
group?: string; // heading, in first-seen order
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
icon?: ReactNode;
|
|
19
|
+
keywords?: string[]; // extra search terms
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Shared props: `options` (required), `mode` (`client` | `server`), `loading`,
|
|
24
|
+
`onSearchChange`, `searchDebounce` (250), `searchable` (true), `hasMore`,
|
|
25
|
+
`onLoadMore`, `filterFn`, `renderOption`, `allowCreate`, `onCreate`, `label`,
|
|
26
|
+
`description`, `error`, `placeholder` ("Select…"), `required`, `disabled`,
|
|
27
|
+
`clearable` (true), `size`, `name`, `maxHeight` (280), `virtualize` (true above
|
|
28
|
+
80 options), `emptyMessage`, `className`, `style`, `localeText`,
|
|
29
|
+
`onOpenChange`, `ref`, and `classNames` (`root` `label` `control` `value` `tag`
|
|
30
|
+
`popover` `search` `list` `option` `footer`).
|
|
31
|
+
|
|
32
|
+
`Select` adds `value`/`defaultValue` (`V | null`) and `closeOnSelect` (true).
|
|
33
|
+
`MultiSelect` adds `value`/`defaultValue` (`V[]`), `max`, `maxVisibleTags` (3),
|
|
34
|
+
`showSelectAll` (true) and `closeOnSelect` (false).
|
|
35
|
+
|
|
36
|
+
`ref` gives `open()`, `close()`, `toggle()`, `focus()`, `clear()`, `getValue()`,
|
|
37
|
+
`getSelectedOptions()`.
|
|
38
|
+
|
|
39
|
+
```tsx
|
|
40
|
+
<Select label="Country" options={countries} value={country} onChange={setCountry} />
|
|
41
|
+
<MultiSelect label="Tags" options={tagOptions} value={tags} onChange={setTags} max={5} />
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Server mode: set `mode="server"`, feed the current results as `options`, and
|
|
45
|
+
handle `onSearchChange` (fires once on open, then debounced) and `onLoadMore`.
|
|
46
|
+
There is no async "load option by value" — pass options that already include the
|
|
47
|
+
selected values.
|
|
48
|
+
|
|
49
|
+
## DatePicker and DateRangePicker
|
|
50
|
+
|
|
51
|
+
`value`, `defaultValue`, `min` and `max` accept a `Date`, an ISO `yyyy-mm-dd`
|
|
52
|
+
string or a timestamp. `onChange` always gives `Date` objects at local midnight.
|
|
53
|
+
`DateRangePicker.onChange` also receives a `complete` flag, `false` after the
|
|
54
|
+
first of two clicks.
|
|
55
|
+
|
|
56
|
+
Shared props: `min`, `max`, `isDateDisabled`, `locale`, `weekStartsOn`,
|
|
57
|
+
`format`, `numberOfMonths`, `showWeekNumbers`, `showToday`, `allowInput` (true),
|
|
58
|
+
`fixedWeeks` (true), `label`, `description`, `error`, `placeholder`, `required`,
|
|
59
|
+
`disabled`, `readOnly`.
|
|
60
|
+
|
|
61
|
+
```tsx
|
|
62
|
+
<DatePicker label="Start date" value={date} onChange={setDate} />
|
|
63
|
+
<DateRangePicker label="Period" value={range} onChange={setRange} />
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## FileUploader
|
|
67
|
+
|
|
68
|
+
`multiple`, `accept`, `maxSize`, `endpoint`, `autoUpload`, `params`,
|
|
69
|
+
`fieldNames`, `onChange`, `onUploadComplete`, plus `label`, `description`,
|
|
70
|
+
`error`. Without an `endpoint` the files post with the surrounding form.
|
|
71
|
+
|
|
72
|
+
Each chunk is a `multipart/form-data` POST carrying `uploadId`, `fileName`,
|
|
73
|
+
`chunkIndex`, `totalChunks`, `fileSize`, `additionalParams` and `chunk`. Answer
|
|
74
|
+
2xx; the last body becomes `item.response`. 5xx/408/429 and network errors retry
|
|
75
|
+
with backoff; other 4xx fail the file.
|
|
76
|
+
|
|
77
|
+
```tsx
|
|
78
|
+
<FileUploader label="Attachments" multiple accept=".pdf,image/*"
|
|
79
|
+
maxSize={20 * 1024 * 1024} endpoint="/api/upload"
|
|
80
|
+
onUploadComplete={(items) => console.log(items.map((i) => i.response))} />
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
`useFileUploader()` exposes the same engine for a custom UI.
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
# Styling
|
|
2
|
+
|
|
3
|
+
These components are styled. They ship a default look, and you replace it at
|
|
4
|
+
three levels: CSS variables, slot classes, and state attributes. Nothing is
|
|
5
|
+
`!important` and nothing needs overriding by specificity.
|
|
6
|
+
|
|
7
|
+
## 1. Stylesheets are per component
|
|
8
|
+
|
|
9
|
+
Each folder has its own `styles.css`. Put the ones you use in the project's
|
|
10
|
+
**global** stylesheet — `src/index.css` in Vite, the root layout's CSS in Next —
|
|
11
|
+
once each:
|
|
12
|
+
|
|
13
|
+
```css
|
|
14
|
+
@import "../component-lib/button/styles.css";
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
**Never import a stylesheet from a component file.** `import
|
|
18
|
+
"component-lib/button/styles.css"` inside a `.tsx` does bundle, but it makes CSS
|
|
19
|
+
order depend on module import order — which decides whether Tailwind utilities
|
|
20
|
+
still beat the component's own rules — and a lazy-loaded component then pulls its
|
|
21
|
+
styles in late, flashing unstyled. One global import per component, nowhere else.
|
|
22
|
+
|
|
23
|
+
Nothing renders correctly without it — the components emit class names only.
|
|
24
|
+
|
|
25
|
+
## 2. Theme with `--gbs-*` on `:root`
|
|
26
|
+
|
|
27
|
+
One set of variables themes every component at once. This is the whole theming
|
|
28
|
+
API; reach for the other levels only when it is not enough.
|
|
29
|
+
|
|
30
|
+
```css
|
|
31
|
+
:root {
|
|
32
|
+
--gbs-accent: #7c3aed;
|
|
33
|
+
--gbs-accent-soft: #f3e8ff;
|
|
34
|
+
--gbs-radius: 10px;
|
|
35
|
+
--gbs-font-size: 14px;
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Set them on `:root`, not inside a component — components read them through
|
|
40
|
+
inheritance, so anything set on an ancestor reaches every control beneath it.
|
|
41
|
+
|
|
42
|
+
### Resolution order
|
|
43
|
+
|
|
44
|
+
Each component variable falls through this chain, stopping at the first set:
|
|
45
|
+
|
|
46
|
+
1. **The component's own variable** — `--in-accent`, `--dg-accent`, `--ck-border`.
|
|
47
|
+
Set this to change one component, or one instance.
|
|
48
|
+
2. **The shared variable** — `--gbs-accent`. The one you normally set.
|
|
49
|
+
3. **The DataGrid's variable** — `--dg-accent`, when the grid's stylesheet is
|
|
50
|
+
loaded. Kept for projects that themed the grid before the shared variables existed.
|
|
51
|
+
4. **The built-in default** — a `light-dark()` pair, so it follows the page's
|
|
52
|
+
colour scheme.
|
|
53
|
+
|
|
54
|
+
```css
|
|
55
|
+
.in-root { --in-accent: var(--gbs-accent, var(--dg-accent, light-dark(#2563eb, #60a5fa))); }
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### The shared variables
|
|
59
|
+
|
|
60
|
+
Defaults written light / dark.
|
|
61
|
+
|
|
62
|
+
**Surfaces and text:** `--gbs-bg` (`#ffffff`/`#0b0b0e`), `--gbs-fg`
|
|
63
|
+
(`#18181b`/`#f4f4f5`), `--gbs-muted` (`#71717a`/`#a1a1aa`), `--gbs-subtle`
|
|
64
|
+
(`#f4f4f5`/`#1c1c20`), `--gbs-hover` (`#f4f4f5`/`#1f1f23`), `--gbs-input-bg`
|
|
65
|
+
(`#ffffff`/`#121216`), `--gbs-readonly-bg` (`#fafafa`/`#0e0e12`),
|
|
66
|
+
`--gbs-header-bg` (`#fafafa`/`#111114`), `--gbs-header-fg` (`#3f3f46`/`#d4d4d8`).
|
|
67
|
+
|
|
68
|
+
**Borders and shape:** `--gbs-border` (`#e4e4e7`/`#27272a`),
|
|
69
|
+
`--gbs-border-subtle` (`#f0f0f2`/`#1c1c20`), `--gbs-border-control`
|
|
70
|
+
(`#a1a1aa`/`#52525b`), `--gbs-radius` (`8px`), `--gbs-font-size` (`13px`),
|
|
71
|
+
`--gbs-shadow`, `--gbs-backdrop`.
|
|
72
|
+
|
|
73
|
+
**Accent and status:** `--gbs-accent`, `--gbs-accent-soft`,
|
|
74
|
+
`--gbs-accent-strong`, `--gbs-accent-fg`, `--gbs-focus`, `--gbs-danger`,
|
|
75
|
+
`--gbs-danger-fg`, `--gbs-success`, `--gbs-warning`, `--gbs-info`.
|
|
76
|
+
|
|
77
|
+
**Grid-specific:** `--gbs-row-alt`, `--gbs-row-hover`, `--gbs-row-selected`,
|
|
78
|
+
`--gbs-row-selected-hover`, `--gbs-cell-px`, `--gbs-pin-shadow`,
|
|
79
|
+
`--gbs-skeleton`, `--gbs-tab-fg`, `--gbs-tooltip-bg`, `--gbs-tooltip-fg`.
|
|
80
|
+
|
|
81
|
+
### Per-component prefixes
|
|
82
|
+
|
|
83
|
+
To change one component only, set its own prefix on its root class:
|
|
84
|
+
|
|
85
|
+
| Component | Prefix | Root class |
|
|
86
|
+
| --- | --- | --- |
|
|
87
|
+
| DataGrid | `--dg-*` | `.dg-root` |
|
|
88
|
+
| Combobox | `--cb-*` | `.cb-root` |
|
|
89
|
+
| Toaster | `--ts-*` | `.ts-region` |
|
|
90
|
+
| Input | `--in-*` | `.in-root` |
|
|
91
|
+
| Button | `--bt-*` | `.bt-root` |
|
|
92
|
+
|
|
93
|
+
```css
|
|
94
|
+
.cb-root { --cb-accent: #7c3aed; --cb-radius: 12px; }
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Toasts render on `<body>`, so grid/shared values they inherit must be set on
|
|
98
|
+
`:root`.
|
|
99
|
+
|
|
100
|
+
## 3. Slot classes
|
|
101
|
+
|
|
102
|
+
`className` goes to the root element only. To reach an inner part, use
|
|
103
|
+
`classNames`, a map of slot name to class string:
|
|
104
|
+
|
|
105
|
+
```tsx
|
|
106
|
+
<Input label="Email" classNames={{ root: "mb-4", label: "font-semibold", input: "font-mono" }} />
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Slots are per component and listed in each `react/props.ts` and in this skill's
|
|
110
|
+
`forms.md` / `overlays.md` / `data-display.md`. Passing a slot that does not
|
|
111
|
+
exist is silently ignored, so check the list.
|
|
112
|
+
|
|
113
|
+
Classes are joined with `cx` from `shared/core/cx.ts`, which drops falsy values
|
|
114
|
+
— a conditional that evaluates to `undefined` contributes nothing.
|
|
115
|
+
|
|
116
|
+
## 4. Cascade layers and Tailwind
|
|
117
|
+
|
|
118
|
+
Every `styles.css` ships **unlayered** — no `@layer` wrapper anywhere:
|
|
119
|
+
|
|
120
|
+
```css
|
|
121
|
+
.bt-root { /* the component's rules */ }
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
That is deliberate. An unlayered rule beats every layered rule regardless of
|
|
125
|
+
specificity, so a layered library loses to any unlayered reset: Tailwind v3's
|
|
126
|
+
preflight and Bootstrap's Reboot both strip borders, padding and radii off
|
|
127
|
+
layered component rules. Unlayered, a class selector beats `*` on ordinary
|
|
128
|
+
specificity and both work with no setup.
|
|
129
|
+
|
|
130
|
+
The app imports the generated barrel once:
|
|
131
|
+
|
|
132
|
+
```css
|
|
133
|
+
@import "./component-lib/gbs.css";
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
With **Tailwind v4** — and only v4, which layers its own utilities — import it
|
|
137
|
+
after the framework and into Tailwind's components layer, so utilities still
|
|
138
|
+
win:
|
|
139
|
+
|
|
140
|
+
```css
|
|
141
|
+
@import "tailwindcss";
|
|
142
|
+
@import "./component-lib/gbs.css" layer(components);
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Both the order and the `layer()` matter. Imported before the framework, the
|
|
146
|
+
`components` layer registers first and Tailwind's preflight lands after it,
|
|
147
|
+
which strips the component rules. Imported without `layer()`, the unlayered
|
|
148
|
+
rules outrank the utilities and `className` stops overriding them.
|
|
149
|
+
|
|
150
|
+
Tailwind **v3** needs neither: it emits utilities unlayered, after our CSS, so
|
|
151
|
+
source order already decides. A project with no CSS framework needs neither.
|
|
152
|
+
|
|
153
|
+
```tsx
|
|
154
|
+
<Button className="w-full sm:w-auto" classNames={{ content: "gap-3" }}>Save</Button>
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Do not use `!important`, and do not write selectors against internal class names
|
|
158
|
+
(`.bt-root`, `.dg-cell`) in app CSS — they are implementation detail. Use the
|
|
159
|
+
variables or the slots.
|
|
160
|
+
|
|
161
|
+
## 4b. Scrollbars
|
|
162
|
+
|
|
163
|
+
Every scrolling surface in the kit is thin by default, using the standard
|
|
164
|
+
`scrollbar-width` / `scrollbar-color` properties (Baseline since December 2024)
|
|
165
|
+
rather than `::-webkit-scrollbar`. Four tokens control all of them:
|
|
166
|
+
|
|
167
|
+
```css
|
|
168
|
+
:root {
|
|
169
|
+
--gbs-scrollbar-width: thin; /* auto | thin | none */
|
|
170
|
+
--gbs-scrollbar-thumb: ...; /* derived from --gbs-accent */
|
|
171
|
+
--gbs-scrollbar-thumb-hover: ...;
|
|
172
|
+
--gbs-scrollbar-track: transparent;
|
|
173
|
+
}
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
Set them on `:root` to restyle every scrollbar, or on one element for one.
|
|
177
|
+
`scrollbar-width` takes no length — only `auto | thin | none`.
|
|
178
|
+
|
|
179
|
+
For your own scrolling areas, add `class="gbs-scroll"` to match. The kit never
|
|
180
|
+
touches scrollbars it was not asked to: an unrelated scroll container keeps the
|
|
181
|
+
browser default.
|
|
182
|
+
|
|
183
|
+
## 5. Unlayered resets (Bootstrap, Normalize)
|
|
184
|
+
|
|
185
|
+
Any stylesheet that ships **unlayered** beats every layered rule regardless of
|
|
186
|
+
specificity — the cascade settles layers before specificity. So Bootstrap's
|
|
187
|
+
Reboot (`button { border-radius: 0 }`, `button, input, textarea { font-size:
|
|
188
|
+
inherit }`) overrides our classes, and import order does not help.
|
|
189
|
+
|
|
190
|
+
Fix it in the project's global CSS by giving the reset its own layer, named
|
|
191
|
+
before `gbs`:
|
|
192
|
+
|
|
193
|
+
```css
|
|
194
|
+
@layer bootstrap, gbs, app, utilities;
|
|
195
|
+
@import url("bootstrap/dist/css/bootstrap.min.css") layer(bootstrap);
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
Only components whose root is a native form element are affected (Button,
|
|
199
|
+
Textarea). Class names never collide — ours are two-letter prefixed.
|
|
200
|
+
|
|
201
|
+
## 6. State attributes
|
|
202
|
+
|
|
203
|
+
Components expose their state as `data-*` attributes, so you can style states
|
|
204
|
+
without tracking them in React.
|
|
205
|
+
|
|
206
|
+
| Attribute | Where |
|
|
207
|
+
| --- | --- |
|
|
208
|
+
| `data-state="open"` / `"closing"` | Combobox, Popover, Menu, Modal, toasts |
|
|
209
|
+
| `data-side` | Popover, Menu, Tooltip — the side it settled on after flipping |
|
|
210
|
+
| `data-size` | Controls that take a `size` |
|
|
211
|
+
| `data-invalid`, `data-disabled` | Form controls |
|
|
212
|
+
| `data-active`, `data-selected` | Combobox options, grid cells and rows |
|
|
213
|
+
| `data-editing`, `data-pinned`, `data-density` | DataGrid |
|
|
214
|
+
| `data-type`, `data-custom`, `data-swiping` | Toasts |
|
|
215
|
+
| `data-position` | Toaster region |
|
|
216
|
+
| `aria-sort` | DataGrid header cells |
|
|
217
|
+
|
|
218
|
+
```css
|
|
219
|
+
.cb-option[data-active] { outline: 2px solid var(--gbs-focus); }
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
## 7. Dark mode
|
|
223
|
+
|
|
224
|
+
Colours are `light-dark()` pairs driven by the page's `color-scheme`, so the
|
|
225
|
+
default is whatever the device prefers. To pin it, set `color-scheme` — the
|
|
226
|
+
components follow:
|
|
227
|
+
|
|
228
|
+
```css
|
|
229
|
+
:root { color-scheme: light dark; } /* follow the device */
|
|
230
|
+
:root[data-theme="dark"] { color-scheme: dark; }
|
|
231
|
+
:root[data-theme="light"] { color-scheme: light; }
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
The DataGrid additionally treats a `.dark` or `[data-theme="dark"]` ancestor as
|
|
235
|
+
forcing a scheme.
|
|
236
|
+
|
|
237
|
+
Do not maintain a second palette for dark mode. Override the `--gbs-*` variables
|
|
238
|
+
with `light-dark()` pairs, or set them inside your own `[data-theme="dark"]`
|
|
239
|
+
block, and every component follows.
|
|
240
|
+
|
|
241
|
+
## 8. Right-to-left
|
|
242
|
+
|
|
243
|
+
The components use logical properties and read `dir` from the document, so RTL
|
|
244
|
+
works without configuration. Arrow keys in Menu, Switch and Tabs mirror
|
|
245
|
+
automatically. The Toaster takes an explicit `dir` prop if one region needs to
|
|
246
|
+
differ from the page.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Toaster and toast
|
|
2
|
+
|
|
3
|
+
Notifications. `toast()` is callable from anywhere — components, event
|
|
4
|
+
handlers, data layers, even outside React. No hook, context or provider.
|
|
5
|
+
|
|
6
|
+
Mount `<Toaster />` **once**; call `toast()` from anywhere — components, event
|
|
7
|
+
handlers, data layers, even outside React. No hook, context or provider.
|
|
8
|
+
|
|
9
|
+
**Import from one path everywhere.** `toast()` and `<Toaster />` meet through a
|
|
10
|
+
shared module-level store; two import paths can create two stores.
|
|
11
|
+
|
|
12
|
+
```tsx
|
|
13
|
+
// once, near the root
|
|
14
|
+
import { Toaster } from "component-lib/toaster";
|
|
15
|
+
<Toaster />
|
|
16
|
+
|
|
17
|
+
// anywhere
|
|
18
|
+
import { toast } from "component-lib/toaster";
|
|
19
|
+
|
|
20
|
+
toast("Event created", { description: "Monday, 10:00" });
|
|
21
|
+
toast.success("Saved");
|
|
22
|
+
toast.error("Upload failed", { action: { label: "Retry", onClick: retry } });
|
|
23
|
+
toast.warning("Storage almost full");
|
|
24
|
+
toast.info("New version available");
|
|
25
|
+
const id = toast.loading("Uploading…"); // stays until updated
|
|
26
|
+
toast.update(id, { type: "success", title: "Uploaded" });
|
|
27
|
+
toast.dismiss(id); // or toast.dismiss() for all
|
|
28
|
+
|
|
29
|
+
toast.promise(saveUser(data), {
|
|
30
|
+
loading: "Saving…",
|
|
31
|
+
success: (user) => `${user.name} saved`,
|
|
32
|
+
error: (error) => `Could not save: ${(error as Error).message}`,
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
toast.custom(({ dismiss }) => <MyCard onClose={dismiss} />);
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Every call returns the toast's id; reusing an on-screen id updates that toast.
|
|
39
|
+
|
|
40
|
+
**Toast options:** `id`, `type` (`default` `success` `error` `warning` `info`
|
|
41
|
+
`loading`), `description`, `duration` (5000; `0`/`Infinity` stays),
|
|
42
|
+
`dismissible`, `action` / `cancel` (`{ label, onClick }`), `icon`, `className`,
|
|
43
|
+
`render`, `onDismiss`, `onAutoClose`.
|
|
44
|
+
|
|
45
|
+
**Toaster props:** `position` (`top-right`), `limit` (3), `duration` (5000),
|
|
46
|
+
`closeButton` (true), `hotkey` (`["altKey","KeyT"]`), `icons`, `store`, `dir`,
|
|
47
|
+
`className`, `classNames`, `style`, `localeText`.
|
|
48
|
+
|
|
49
|
+
Slots: `region`, `list`, `toast`, `icon`, `content`, `title`, `description`,
|
|
50
|
+
`actions`, `action`, `cancel`, `close`.
|
|
51
|
+
|
|
52
|
+
Timers pause while the pointer is over the stack, while focus is inside it, and
|
|
53
|
+
while the tab is hidden. The list is a polite live region; error toasts use
|
|
54
|
+
`role="alert"`. **Alt+T** moves focus to the notifications.
|
|
55
|
+
|
|
56
|
+
`toast()` does nothing during a server render — call it in the browser, e.g.
|
|
57
|
+
after a Server Action resolves.
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 2.4.1
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
**The stylesheet import printed after an install is now one you can paste.**
|
|
8
|
+
|
|
9
|
+
2.4.0 could put the components under `src/`, and printed the path to the
|
|
10
|
+
barrel from the project root -- which is correct from nowhere in particular.
|
|
11
|
+
In a Next.js app it read:
|
|
12
|
+
|
|
13
|
+
```css
|
|
14
|
+
@import "./src/component-lib/gbs.css" layer(components);
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
while the file to edit was `src/app/globals.css`, two directories away. You
|
|
18
|
+
had to work out the `../` yourself.
|
|
19
|
+
|
|
20
|
+
The installer now finds your global stylesheet in the usual places
|
|
21
|
+
(`src/app/globals.css`, `app/globals.css`, `src/styles/globals.css`,
|
|
22
|
+
`src/index.css` and friends), names it, and writes the path from there:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
Add this to src/app/globals.css:
|
|
26
|
+
|
|
27
|
+
@import "tailwindcss";
|
|
28
|
+
@import "../component-lib/gbs.css" layer(components);
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Where no stylesheet is found it falls back to the path from the project root,
|
|
32
|
+
as before. The header inside the generated `gbs.css` follows the same rule.
|
|
33
|
+
|
|
34
|
+
Nothing about the installed components changed; this is the installer's
|
|
35
|
+
output only.
|
|
36
|
+
|
|
37
|
+
## 2.4.0
|
|
38
|
+
|
|
39
|
+
The first release published as **`@grampro/kit`**. `gbs-add-block` keeps
|
|
40
|
+
working for now and installs the same components, but new work happens here.
|
|
41
|
+
|
|
42
|
+
### The package has a new name
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npx @grampro/kit add DataGrid
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
`npx gbs-add-block` still resolves, and the `gbs-add-block` binary is still
|
|
49
|
+
installed, so existing scripts keep running. Both will stay for a few
|
|
50
|
+
releases before the old name is deprecated.
|
|
51
|
+
|
|
52
|
+
### Commands read as commands
|
|
53
|
+
|
|
54
|
+
`add`, `list`, `skill` and `passport` are verbs now:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
npx @grampro/kit add Button DataGrid
|
|
58
|
+
npx @grampro/kit list
|
|
59
|
+
npx @grampro/kit skill --for claude
|
|
60
|
+
npx @grampro/kit passport --check
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
The old flag spellings (`-a Button`, `-skill`, `-passport`) still work and
|
|
64
|
+
print the new spelling once. `--legacy` reaches the 1.x component set, which
|
|
65
|
+
is where `--beta` went: it used to opt *in* to the current components, and
|
|
66
|
+
there is nothing left to opt into.
|
|
67
|
+
|
|
68
|
+
### You choose where components land
|
|
69
|
+
|
|
70
|
+
The destination was fixed at `component-lib/` in the directory you ran the
|
|
71
|
+
command from, which put it beside `src/` rather than inside it for most
|
|
72
|
+
projects. Now:
|
|
73
|
+
|
|
74
|
+
- `--dest <path>` puts them wherever you want.
|
|
75
|
+
- Failing that, an install already in the project wins, so a second `add`
|
|
76
|
+
lands beside the first. That is how a custom `--dest` is remembered; no
|
|
77
|
+
config file is written into your project.
|
|
78
|
+
- Failing that, a project with a `src/` folder gets `src/component-lib/`,
|
|
79
|
+
and everything else keeps `component-lib/` at the root.
|
|
80
|
+
|
|
81
|
+
Nothing moves on its own: if you already have `component-lib/`, that is
|
|
82
|
+
still where components go.
|
|
83
|
+
|
|
84
|
+
The stylesheet import printed after an install now names the path the files
|
|
85
|
+
actually landed at, relative to your project root.
|
|
86
|
+
|
|
87
|
+
### Fixed
|
|
88
|
+
|
|
89
|
+
- `add Button --dest app/ui` tried to install a component called `app/ui`.
|
|
90
|
+
A flag's value was being read as a component name; the same was true of
|
|
91
|
+
`--for`.
|
|
92
|
+
|
|
93
|
+
### Internal
|
|
94
|
+
|
|
95
|
+
The library source moved from `source/beta-components` to
|
|
96
|
+
`source/components`, and the 1.x set from `source/components` to
|
|
97
|
+
`source/legacy-components`. This changes nothing for installed components —
|
|
98
|
+
the files you receive and their import paths are identical — but every
|
|
99
|
+
`passport.json` has a new `sourceHash`, because that hash covers
|
|
100
|
+
repo-relative paths.
|
|
101
|
+
|
|
102
|
+
## 2.3.0
|
|
103
|
+
|
|
104
|
+
Published as a minor, but **it contains one breaking change to styling**. Read
|
|
105
|
+
the upgrade note below before updating.
|
|
106
|
+
|
|
107
|
+
### Breaking: component CSS is no longer in a cascade layer
|
|
108
|
+
|
|
109
|
+
Component rules used to live in `@layer gbs`, and 2.1.0 asked Tailwind v4
|
|
110
|
+
projects to add `@layer gbs, utilities;` to their global CSS. Both are gone.
|
|
111
|
+
|
|
112
|
+
A cascade layer loses to *any* unlayered stylesheet regardless of specificity,
|
|
113
|
+
and Tailwind v3's preflight and Bootstrap's Reboot are both unlayered. Measured
|
|
114
|
+
on 2.2.0: under Tailwind v3 the components rendered with `border: 0` and
|
|
115
|
+
`padding-left: 0`; under Bootstrap every button was square. No host-side
|
|
116
|
+
declaration could fix either, because nothing layered can outrank unlayered CSS.
|
|
117
|
+
|
|
118
|
+
Component CSS now ships unlayered and wins on ordinary specificity, so Tailwind
|
|
119
|
+
v3, Bootstrap and framework-free projects work with no setup at all.
|
|
120
|
+
|
|
121
|
+
**What to change:**
|
|
122
|
+
|
|
123
|
+
- Delete any `@layer gbs, utilities;` (or similar) line you added for 2.1.0.
|
|
124
|
+
- Import the generated barrel instead of individual stylesheets:
|
|
125
|
+
`@import "./component-lib/gbs.css";`
|
|
126
|
+
- **Tailwind v4 only** — import it after the framework and into its components
|
|
127
|
+
layer, or utilities stop overriding component rules:
|
|
128
|
+
```css
|
|
129
|
+
@import "tailwindcss";
|
|
130
|
+
@import "./component-lib/gbs.css" layer(components);
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
The installer detects which line you need and prints it.
|
|
134
|
+
|
|
135
|
+
### Added
|
|
136
|
+
|
|
137
|
+
- **`<DataGrid ai />`** — a natural-language input above the grid, driven by an
|
|
138
|
+
adapter the application supplies through `<GramproAIProvider>`. No model is
|
|
139
|
+
bundled, downloaded or named, and with no provider the prop renders nothing.
|
|
140
|
+
- **WebMCP** — `registerGridTool(agent)` exposes one tool, `operate_grid`, to a
|
|
141
|
+
browser agent. Its schema is generated from the live grid. Needs no model.
|
|
142
|
+
- **Generated stylesheet barrel** — the CLI writes `component-lib/gbs.css` on
|
|
143
|
+
every install, so the import list stays correct as you add components.
|
|
144
|
+
- **Thin scrollbars** across every scrolling surface, themeable from `:root`
|
|
145
|
+
via `--gbs-scrollbar-width`, `--gbs-scrollbar-thumb`,
|
|
146
|
+
`--gbs-scrollbar-thumb-hover` and `--gbs-scrollbar-track`. Add
|
|
147
|
+
`class="gbs-scroll"` to your own scroll areas to match. Scroll containers the
|
|
148
|
+
kit does not own are left alone.
|
|
149
|
+
|
|
150
|
+
### Security
|
|
151
|
+
|
|
152
|
+
- Pinned `dompurify` to `^3.4.16` via `overrides`, clearing two DOM XSS
|
|
153
|
+
advisories reachable through `@grampro/headless-helpers → jspdf`. The 2.0 beta
|
|
154
|
+
components never used that chain. `npm audit` is now clean.
|
|
155
|
+
- Removed the `path` dependency. `require("path")` resolves to Node's built-in,
|
|
156
|
+
so the npm package was inert — a deprecated userland shim sitting in the
|
|
157
|
+
dependency tree for no reason.
|
|
158
|
+
|
|
159
|
+
### Documentation
|
|
160
|
+
|
|
161
|
+
- Documented what leaves the page with a remote AI adapter: the runtime contract
|
|
162
|
+
carries real values from low-cardinality columns. Mark personal columns
|
|
163
|
+
`semantics: { email: { pii: true } }` — a PII column is denied *and* never
|
|
164
|
+
summarised — or pass `stats: false`. Note that `policy.denyFilter` governs what
|
|
165
|
+
may be *done* with a column, not whether it may be *described*.
|
|
166
|
+
- Corrected the agent skill's install instructions, which still told agents to
|
|
167
|
+
import each stylesheet individually with no `layer()`.
|
|
168
|
+
|
|
169
|
+
### Packaging
|
|
170
|
+
|
|
171
|
+
- Test files are no longer published (35 files, 233 KB). They were filtered out
|
|
172
|
+
at install time anyway.
|
|
173
|
+
- Added `repository`, `homepage` and `bugs` metadata.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Grampro Business Services
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
10
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
11
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
12
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
13
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
14
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
15
|
+
PERFORMANCE OF THIS SOFTWARE.
|