@optimum-intelligence/opti-ui 0.3.0 → 0.5.0
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 +28 -7
- package/dist/components/accordion/Accordion.d.ts +12 -0
- package/dist/components/accordion/Accordion.js +12 -0
- package/dist/components/accordion/Accordion.js.map +1 -1
- package/dist/components/alert/Alert.d.ts +4 -0
- package/dist/components/alert/Alert.js.map +1 -1
- package/dist/components/app-shell/AppShell.d.ts +96 -5
- package/dist/components/app-shell/AppShell.js +676 -185
- package/dist/components/app-shell/AppShell.js.map +1 -1
- package/dist/components/avatar/Avatar.d.ts +8 -0
- package/dist/components/avatar/Avatar.js +2 -0
- package/dist/components/avatar/Avatar.js.map +1 -1
- package/dist/components/badge/Badge.d.ts +10 -3
- package/dist/components/badge/Badge.js +17 -28
- package/dist/components/badge/Badge.js.map +1 -1
- package/dist/components/breadcrumbs/Breadcrumbs.d.ts +1 -0
- package/dist/components/breadcrumbs/Breadcrumbs.js.map +1 -1
- package/dist/components/button/Button.d.ts +8 -0
- package/dist/components/button/Button.js +6 -0
- package/dist/components/button/Button.js.map +1 -1
- package/dist/components/calendar/Calendar.d.ts +21 -7
- package/dist/components/calendar/Calendar.js +285 -212
- package/dist/components/calendar/Calendar.js.map +1 -1
- package/dist/components/calendar/DateConfig.d.ts +37 -0
- package/dist/components/calendar/DateConfig.js +75 -0
- package/dist/components/calendar/DateConfig.js.map +1 -0
- package/dist/components/calendar/date-utils.d.ts +41 -6
- package/dist/components/calendar/date-utils.js +119 -20
- package/dist/components/calendar/date-utils.js.map +1 -1
- package/dist/components/card/Card.d.ts +13 -0
- package/dist/components/card/Card.js +13 -0
- package/dist/components/card/Card.js.map +1 -1
- package/dist/components/choice/Choice.d.ts +13 -0
- package/dist/components/choice/Choice.js +10 -0
- package/dist/components/choice/Choice.js.map +1 -1
- package/dist/components/combobox/Combobox.d.ts +12 -0
- package/dist/components/combobox/Combobox.js.map +1 -1
- package/dist/components/command-palette/CommandPalette.d.ts +10 -0
- package/dist/components/command-palette/CommandPalette.js.map +1 -1
- package/dist/components/data-table/DataTable.d.ts +4 -0
- package/dist/components/data-table/DataTable.js.map +1 -1
- package/dist/components/data-table/DataTableContent.d.ts +1 -0
- package/dist/components/data-table/DataTableContent.js +3 -3
- package/dist/components/data-table/DataTableContent.js.map +1 -1
- package/dist/components/data-table/DataTableFilters.d.ts +3 -0
- package/dist/components/data-table/DataTableFilters.js.map +1 -1
- package/dist/components/data-table/types.d.ts +16 -0
- package/dist/components/date-picker/DatePicker.d.ts +33 -10
- package/dist/components/date-picker/DatePicker.js +315 -279
- package/dist/components/date-picker/DatePicker.js.map +1 -1
- package/dist/components/date-picker/DateRangePicker.d.ts +12 -4
- package/dist/components/date-picker/DateRangePicker.js +240 -206
- package/dist/components/date-picker/DateRangePicker.js.map +1 -1
- package/dist/components/date-picker/PickerField.d.ts +13 -0
- package/dist/components/date-picker/PickerField.js +1 -1
- package/dist/components/date-picker/PickerField.js.map +1 -1
- package/dist/components/dialog/Dialog.d.ts +5 -0
- package/dist/components/dialog/Dialog.js.map +1 -1
- package/dist/components/drawer/Drawer.d.ts +10 -0
- package/dist/components/drawer/Drawer.js.map +1 -1
- package/dist/components/empty-state/EmptyState.d.ts +5 -0
- package/dist/components/empty-state/EmptyState.js.map +1 -1
- package/dist/components/file-upload/FileUpload.d.ts +21 -0
- package/dist/components/file-upload/FileUpload.js.map +1 -1
- package/dist/components/input/Input.d.ts +7 -0
- package/dist/components/input/Input.js +3 -0
- package/dist/components/input/Input.js.map +1 -1
- package/dist/components/link/Link.d.ts +1 -0
- package/dist/components/link/Link.js.map +1 -1
- package/dist/components/menu/Menu.d.ts +6 -0
- package/dist/components/menu/Menu.js.map +1 -1
- package/dist/components/number-field/NumberField.d.ts +7 -0
- package/dist/components/number-field/NumberField.js.map +1 -1
- package/dist/components/pagination/Pagination.d.ts +4 -0
- package/dist/components/pagination/Pagination.js.map +1 -1
- package/dist/components/popover/Popover.d.ts +4 -0
- package/dist/components/popover/Popover.js.map +1 -1
- package/dist/components/preview-card/PreviewCard.d.ts +4 -0
- package/dist/components/preview-card/PreviewCard.js.map +1 -1
- package/dist/components/progress/Progress.d.ts +8 -0
- package/dist/components/progress/Progress.js.map +1 -1
- package/dist/components/scroll-area/ScrollArea.d.ts +1 -0
- package/dist/components/scroll-area/ScrollArea.js.map +1 -1
- package/dist/components/search-input/SearchInput.d.ts +2 -0
- package/dist/components/search-input/SearchInput.js.map +1 -1
- package/dist/components/select/Select.d.ts +11 -0
- package/dist/components/select/Select.js.map +1 -1
- package/dist/components/separator/Separator.d.ts +1 -0
- package/dist/components/separator/Separator.js +1 -0
- package/dist/components/separator/Separator.js.map +1 -1
- package/dist/components/skeleton/Skeleton.d.ts +7 -0
- package/dist/components/skeleton/Skeleton.js +1 -0
- package/dist/components/skeleton/Skeleton.js.map +1 -1
- package/dist/components/slider/Slider.d.ts +1 -0
- package/dist/components/slider/Slider.js.map +1 -1
- package/dist/components/spinner/Spinner.d.ts +2 -0
- package/dist/components/spinner/Spinner.js +1 -0
- package/dist/components/spinner/Spinner.js.map +1 -1
- package/dist/components/stat-card/StatCard.d.ts +4 -0
- package/dist/components/stat-card/StatCard.js.map +1 -1
- package/dist/components/stepper/Stepper.d.ts +4 -0
- package/dist/components/stepper/Stepper.js.map +1 -1
- package/dist/components/table/Table.d.ts +24 -1
- package/dist/components/table/Table.js +19 -2
- package/dist/components/table/Table.js.map +1 -1
- package/dist/components/tabs/Tabs.d.ts +1 -0
- package/dist/components/tabs/Tabs.js.map +1 -1
- package/dist/components/tag/Tag.d.ts +3 -0
- package/dist/components/tag/Tag.js.map +1 -1
- package/dist/components/toast/Toast.d.ts +2 -0
- package/dist/components/toast/Toast.js.map +1 -1
- package/dist/components/toggle/Toggle.d.ts +7 -0
- package/dist/components/toggle/Toggle.js +1 -0
- package/dist/components/toggle/Toggle.js.map +1 -1
- package/dist/components/tooltip/Tooltip.d.ts +8 -0
- package/dist/components/tooltip/Tooltip.js.map +1 -1
- package/dist/components/typography/Typography.d.ts +5 -0
- package/dist/components/typography/Typography.js +2 -0
- package/dist/components/typography/Typography.js.map +1 -1
- package/dist/components.json +5534 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4 -3
- package/dist/llms-full.txt +2707 -0
- package/dist/llms.txt +177 -0
- package/dist/opti-ui.css +171 -81
- package/dist/theme/ThemeProvider.d.ts +1 -0
- package/dist/theme/ThemeProvider.js.map +1 -1
- package/dist/utils/portal.d.ts +4 -0
- package/dist/utils/portal.js +4 -0
- package/dist/utils/portal.js.map +1 -1
- package/package.json +7 -3
package/README.md
CHANGED
|
@@ -4,6 +4,25 @@ Optimum Intelligence's shared React component library. It is built on [Base UI](
|
|
|
4
4
|
behaviour and accessibility, with a Poppins/Montserrat look: deep purple `#271645`, accent `#63537d`,
|
|
5
5
|
soft tinted borders and rounded controls. Everything is themeable through CSS variables.
|
|
6
6
|
|
|
7
|
+
## API docs for humans and AI agents
|
|
8
|
+
|
|
9
|
+
The package ships its own API reference, generated from the source on every build, so it always matches
|
|
10
|
+
the installed version:
|
|
11
|
+
|
|
12
|
+
| File | Use |
|
|
13
|
+
| --- | --- |
|
|
14
|
+
| `llms.txt` | Short index: setup plus every component with a one-line description. Start here. |
|
|
15
|
+
| `llms-full.txt` | Full reference in markdown: every component and part, props with types, allowed values, defaults and descriptions, examples. |
|
|
16
|
+
| `components.json` | The same data as JSON (`import manifest from '@optimum-intelligence/opti-ui/components.json'`). |
|
|
17
|
+
| `dist/**/*.d.ts` | Exact prop types with JSDoc, shown by editors on hover. |
|
|
18
|
+
|
|
19
|
+
AI agents: read `node_modules/@optimum-intelligence/opti-ui/llms.txt` before using the library, then look
|
|
20
|
+
up a component in `llms-full.txt`. Do not guess prop names.
|
|
21
|
+
|
|
22
|
+
Docs come from JSDoc in `src/`. To improve them, document the component (`/** … */` with an optional
|
|
23
|
+
`@example`) and its props, then run `npm run build`; the build fails while an export or prop is
|
|
24
|
+
undocumented. Contributor and agent rules are in `AGENTS.md`.
|
|
25
|
+
|
|
7
26
|
## Showcase
|
|
8
27
|
|
|
9
28
|
```sh
|
|
@@ -53,24 +72,26 @@ so the components work in Next.js App Router.
|
|
|
53
72
|
|
|
54
73
|
| Area | Components |
|
|
55
74
|
| --- | --- |
|
|
56
|
-
| Layout | `AppShell`, `Navbar` (+ `NavbarHeader/Brand/Section/SectionLabel/Item/Footer`), `PageHeader`, `Grid`, `Stack`, `Card` (+ parts), `StatCard`, `Separator`, `ScrollArea` |
|
|
75
|
+
| Layout | `AppShell`, `Navbar` (+ `NavbarHeader/Brand/Section/SectionLabel/Item/Group/Footer`), `PageHeader`, `Grid`, `Stack`, `Card` (+ parts), `StatCard`, `Separator`, `ScrollArea` |
|
|
57
76
|
| Actions | `Button`, `IconButton`, `Toggle`, `ToggleGroup`, `SegmentedControl`, `Menu.*`, `ContextMenu.*`, `Toolbar.*` |
|
|
58
77
|
| Forms | `Field.*`, `Fieldset.*`, `Form`, `Input`, `TextField`, `PasswordInput`, `PasswordField`, `Textarea`, `TextareaField`, `Select` (+ parts), `Combobox` (+ parts), `Checkbox`, `CheckboxGroup`, `Radio`, `RadioGroup`, `Switch`, `NumberField`, `Slider`, `SearchInput`, `DatePicker`, `DateTimePicker`, `DateRangePicker`, `Calendar`, `RangeCalendar`, `FileUpload`, `Dropzone`, `FileItem` |
|
|
59
78
|
| Overlays | `Dialog.*` (modal, or a sheet with `placement`), `AlertDialog.*`, `Drawer` (detail side panel), `Popover.*`, `PreviewCard.*`, `Tooltip`, `ToastProvider` + `useToast()`, `CommandPalette` |
|
|
60
79
|
| Disclosure & navigation | `Tabs.*`, `Accordion.*`, `Collapsible.*`, `Breadcrumbs` + `Breadcrumb`, `Pagination`, `Stepper` |
|
|
61
80
|
| Feedback & data | `Alert`, `Badge`, `Tag`, `Avatar`, `AvatarGroup`, `Progress`, `Meter`, `Skeleton`, `SkeletonText`, `Spinner`, `Table` (+ parts), `DataTable`, `EmptyState`, `Heading`, `Text`, `Eyebrow`, `Link` |
|
|
62
|
-
| Theme | `ThemeProvider`, `createTheme`, `themeToStyle`, icons (`CheckIcon`, `ChevronDownIcon`, …) |
|
|
81
|
+
| Theme | `ThemeProvider`, `createTheme`, `themeToStyle`, `DateConfigProvider`, `useDateConfig`, icons (`CheckIcon`, `ChevronDownIcon`, …) |
|
|
63
82
|
|
|
64
83
|
Components with a common one-line form can be called directly, and their parts are attached for full
|
|
65
84
|
control: `<Select items={…} />` or `<Select.Root>…<Select.Trigger/>…</Select.Root>`; the same applies to
|
|
66
85
|
`Combobox` and `Tooltip`. Compound components (`Dialog`, `Menu`, `Tabs`, …) mirror Base UI's part names,
|
|
67
86
|
so the [Base UI docs](https://base-ui.com/react/overview/quick-start) apply to them directly.
|
|
68
87
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
(`
|
|
73
|
-
|
|
88
|
+
Calendar dates are plain ISO strings (`"2026-03-09"`), the same format as native date inputs;
|
|
89
|
+
`DateRangePicker` uses `{ start, end }` with both days inclusive. Date-times are UTC instants
|
|
90
|
+
(`"2026-03-09T13:30:00Z"`), shown and edited in `timeZone` (the browser's by default) and converted back on
|
|
91
|
+
commit. `granularity` (`year` … `second`) picks the grid or time fields and cuts the value to that unit.
|
|
92
|
+
Display is ISO-style on a 24-hour clock (`2026-03-09 14:30`) unless you pass a `format` pattern
|
|
93
|
+
(`"DD.MM.YYYY"`, `"MMMM YYYY"`). `formatDate` formats values the same way outside the pickers, and
|
|
94
|
+
`DateConfigProvider` sets app-wide defaults for locale, time zone, week start and formats.
|
|
74
95
|
|
|
75
96
|
`DataTable` handles search, filters, sorting, pagination, selection, row actions and inline editing for
|
|
76
97
|
rows held in memory. Columns declare what they take part in:
|
|
@@ -8,6 +8,18 @@ declare function AccordionItem({ className, ref, ...props }: BaseAccordion.Item.
|
|
|
8
8
|
/** Header + trigger + chevron in one. */
|
|
9
9
|
declare function AccordionTrigger({ className, children, ref, ...props }: BaseAccordion.Trigger.Props): import("react").JSX.Element;
|
|
10
10
|
declare function AccordionPanel({ className, children, ref, ...props }: BaseAccordion.Panel.Props): import("react").JSX.Element;
|
|
11
|
+
/**
|
|
12
|
+
* Expandable sections. Compose `Accordion.Root` › `Accordion.Item` (give each a `value`) ›
|
|
13
|
+
* `Accordion.Trigger` + `Accordion.Panel`. Pass `multiple` to `Root` to allow several open at once.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* <Accordion.Root defaultValue={['a']}>
|
|
17
|
+
* <Accordion.Item value="a">
|
|
18
|
+
* <Accordion.Trigger>Billing</Accordion.Trigger>
|
|
19
|
+
* <Accordion.Panel>…</Accordion.Panel>
|
|
20
|
+
* </Accordion.Item>
|
|
21
|
+
* </Accordion.Root>
|
|
22
|
+
*/
|
|
11
23
|
export declare const Accordion: {
|
|
12
24
|
Root: typeof AccordionRoot;
|
|
13
25
|
Item: typeof AccordionItem;
|
|
@@ -192,6 +192,18 @@ function AccordionPanel(t0) {
|
|
|
192
192
|
} else t3 = $[13];
|
|
193
193
|
return t3;
|
|
194
194
|
}
|
|
195
|
+
/**
|
|
196
|
+
* Expandable sections. Compose `Accordion.Root` › `Accordion.Item` (give each a `value`) ›
|
|
197
|
+
* `Accordion.Trigger` + `Accordion.Panel`. Pass `multiple` to `Root` to allow several open at once.
|
|
198
|
+
*
|
|
199
|
+
* @example
|
|
200
|
+
* <Accordion.Root defaultValue={['a']}>
|
|
201
|
+
* <Accordion.Item value="a">
|
|
202
|
+
* <Accordion.Trigger>Billing</Accordion.Trigger>
|
|
203
|
+
* <Accordion.Panel>…</Accordion.Panel>
|
|
204
|
+
* </Accordion.Item>
|
|
205
|
+
* </Accordion.Root>
|
|
206
|
+
*/
|
|
195
207
|
var Accordion$1 = {
|
|
196
208
|
Root: AccordionRoot,
|
|
197
209
|
Item: AccordionItem,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.js","names":["Accordion","BaseAccordion","withClass","ChevronDownIcon","AccordionRootProps","Root","Props","variant","AccordionRoot","t0","$","_c","className","props","ref","t1","undefined","t2","t3","AccordionItem","AccordionTrigger","children","Symbol","for","t4","AccordionPanel","Item","Trigger","Panel","_c","BaseAccordion","Accordion"],"sources":["../../../src/components/accordion/Accordion.tsx"],"sourcesContent":["import { Accordion as BaseAccordion } from '@base-ui/react/accordion';\nimport { withClass } from '../../utils/cx';\nimport { ChevronDownIcon } from '../../icons';\n\nexport interface AccordionRootProps extends BaseAccordion.Root.Props {\n /** `separated` renders each item as its own card; `plain` uses dividers. */\n variant?: 'separated' | 'plain';\n}\n\nfunction AccordionRoot({ variant = 'plain', className, ref, ...props }: AccordionRootProps) {\n return (\n <BaseAccordion.Root ref={ref} className={withClass('oui-accordion', className)} data-variant={variant} {...props} />\n );\n}\n\nfunction AccordionItem({ className, ref, ...props }: BaseAccordion.Item.Props) {\n return <BaseAccordion.Item ref={ref} className={withClass('oui-accordion__item', className)} {...props} />;\n}\n\n/** Header + trigger + chevron in one. */\nfunction AccordionTrigger({ className, children, ref, ...props }: BaseAccordion.Trigger.Props) {\n return (\n <BaseAccordion.Header className=\"oui-accordion__header\">\n <BaseAccordion.Trigger ref={ref} className={withClass('oui-accordion__trigger', className)} {...props}>\n <span className=\"oui-accordion__trigger-label\">{children}</span>\n <ChevronDownIcon className=\"oui-accordion__chevron\" />\n </BaseAccordion.Trigger>\n </BaseAccordion.Header>\n );\n}\n\nfunction AccordionPanel({ className, children, ref, ...props }: BaseAccordion.Panel.Props) {\n return (\n <BaseAccordion.Panel ref={ref} className={withClass('oui-accordion__panel', className)} {...props}>\n <div className=\"oui-accordion__content\">{children}</div>\n </BaseAccordion.Panel>\n );\n}\n\nexport const Accordion = {\n Root: AccordionRoot,\n Item: AccordionItem,\n Trigger: AccordionTrigger,\n Panel: AccordionPanel,\n};\n"],"mappings":";;;;;;;AASA,SAAAQ,cAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAC;CAAA,IAAAC;C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KAAAW;EAAAX,EAAA,KAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,IAAAQ;CAAA,IAAAR,EAAA,OAAAG,SAAAH,EAAA,QAAAI,OAAAJ,EAAA,QAAAK,MAAAL,EAAA,QAAAO,IAAA;EAD1DC,KAAA,oBAAAY,UAAA,OAAA;GAA0BhB;GAAgB,WAAAC;GAA4C,GAAMF;GAC1FI,UAAAA;EACF,CAAA;EAAsBP,EAAA,KAAAG;EAAAH,EAAA,MAAAI;EAAAJ,EAAA,MAAAK;EAAAL,EAAA,MAAAO;EAAAP,EAAA,MAAAQ;CAAA,OAAAA,KAAAR,EAAA;CAAA,OAFtBQ;AAEsB
|
|
1
|
+
{"version":3,"file":"Accordion.js","names":["Accordion","BaseAccordion","withClass","ChevronDownIcon","AccordionRootProps","Root","Props","variant","AccordionRoot","t0","$","_c","className","props","ref","t1","undefined","t2","t3","AccordionItem","AccordionTrigger","children","Symbol","for","t4","AccordionPanel","Item","Trigger","Panel","_c","BaseAccordion","Accordion"],"sources":["../../../src/components/accordion/Accordion.tsx"],"sourcesContent":["import { Accordion as BaseAccordion } from '@base-ui/react/accordion';\nimport { withClass } from '../../utils/cx';\nimport { ChevronDownIcon } from '../../icons';\n\nexport interface AccordionRootProps extends BaseAccordion.Root.Props {\n /** `separated` renders each item as its own card; `plain` uses dividers. */\n variant?: 'separated' | 'plain';\n}\n\nfunction AccordionRoot({ variant = 'plain', className, ref, ...props }: AccordionRootProps) {\n return (\n <BaseAccordion.Root ref={ref} className={withClass('oui-accordion', className)} data-variant={variant} {...props} />\n );\n}\n\nfunction AccordionItem({ className, ref, ...props }: BaseAccordion.Item.Props) {\n return <BaseAccordion.Item ref={ref} className={withClass('oui-accordion__item', className)} {...props} />;\n}\n\n/** Header + trigger + chevron in one. */\nfunction AccordionTrigger({ className, children, ref, ...props }: BaseAccordion.Trigger.Props) {\n return (\n <BaseAccordion.Header className=\"oui-accordion__header\">\n <BaseAccordion.Trigger ref={ref} className={withClass('oui-accordion__trigger', className)} {...props}>\n <span className=\"oui-accordion__trigger-label\">{children}</span>\n <ChevronDownIcon className=\"oui-accordion__chevron\" />\n </BaseAccordion.Trigger>\n </BaseAccordion.Header>\n );\n}\n\nfunction AccordionPanel({ className, children, ref, ...props }: BaseAccordion.Panel.Props) {\n return (\n <BaseAccordion.Panel ref={ref} className={withClass('oui-accordion__panel', className)} {...props}>\n <div className=\"oui-accordion__content\">{children}</div>\n </BaseAccordion.Panel>\n );\n}\n\n/**\n * Expandable sections. Compose `Accordion.Root` › `Accordion.Item` (give each a `value`) ›\n * `Accordion.Trigger` + `Accordion.Panel`. Pass `multiple` to `Root` to allow several open at once.\n *\n * @example\n * <Accordion.Root defaultValue={['a']}>\n * <Accordion.Item value=\"a\">\n * <Accordion.Trigger>Billing</Accordion.Trigger>\n * <Accordion.Panel>…</Accordion.Panel>\n * </Accordion.Item>\n * </Accordion.Root>\n */\nexport const Accordion = {\n Root: AccordionRoot,\n Item: AccordionItem,\n Trigger: AccordionTrigger,\n Panel: AccordionPanel,\n};\n"],"mappings":";;;;;;;AASA,SAAAQ,cAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAL,EAAA,OAAAD,IAAA;EAAuB,CAAA,CAAAF,SAAAQ,IAAAH,WAAAE,KAAA,GAAAD,SAAAJ;EAAmEC,EAAA,KAAAD;EAAAC,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;CAAA,OAAA;EAAAH,YAAAF,EAAA;EAAAG,QAAAH,EAAA;EAAAI,MAAAJ,EAAA;EAAAK,KAAAL,EAAA;CAAA;CAAjE,MAAAH,UAAAQ,OAAAC,KAAAA,IAAA,UAAAD;CAAiB,IAAAE;CAAA,IAAAP,EAAA,OAAAE,WAAA;EAEGK,KAAAf,UAAU,iBAAiBU,SAAS;EAACF,EAAA,KAAAE;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P;CACNQ,SAASP;CACTQ,OAAOH;AACT"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export type AlertTone = 'info' | 'success' | 'warning' | 'danger' | 'neutral';
|
|
3
3
|
export interface AlertProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
4
|
+
/** Ref to the alert element. */
|
|
4
5
|
ref?: React.Ref<HTMLDivElement>;
|
|
6
|
+
/** Semantic color and default icon. `danger` and `warning` announce as an alert role. */
|
|
5
7
|
tone?: AlertTone;
|
|
6
8
|
/** `soft` (tinted, default) or `outline`. */
|
|
7
9
|
variant?: 'soft' | 'outline';
|
|
10
|
+
/** Bold first line above the message. */
|
|
8
11
|
title?: React.ReactNode;
|
|
9
12
|
/** Custom icon, or `false` to hide it. */
|
|
10
13
|
icon?: React.ReactNode | false;
|
|
@@ -12,6 +15,7 @@ export interface AlertProps extends Omit<React.HTMLAttributes<HTMLDivElement>, '
|
|
|
12
15
|
actions?: React.ReactNode;
|
|
13
16
|
/** Shows a dismiss button. */
|
|
14
17
|
onDismiss?: () => void;
|
|
18
|
+
/** Accessible name of the dismiss button. */
|
|
15
19
|
dismissLabel?: string;
|
|
16
20
|
}
|
|
17
21
|
/** Inline message for page- or section-level feedback. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.js","names":["React","cx","CircleCheckIcon","CircleXIcon","InfoIcon","TriangleAlertIcon","XIcon","IconButton","AlertTone","AlertProps","Omit","HTMLAttributes","HTMLDivElement","ref","Ref","tone","variant","title","ReactNode","icon","actions","onDismiss","dismissLabel","defaultIcons","Record","info","neutral","success","warning","danger","Alert","t0","$","_c","children","className","props","t1","t2","t3","undefined","urgent","iconNode","t4","t5","t6","t7","t8","t9","t10","t11","t12","_c"],"sources":["../../../src/components/alert/Alert.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cx } from '../../utils/cx';\nimport { CircleCheckIcon, CircleXIcon, InfoIcon, TriangleAlertIcon, XIcon } from '../../icons';\nimport { IconButton } from '../button/Button';\n\nexport type AlertTone = 'info' | 'success' | 'warning' | 'danger' | 'neutral';\n\nexport interface AlertProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {\n ref?: React.Ref<HTMLDivElement>;\n tone?: AlertTone;\n /** `soft` (tinted, default) or `outline`. */\n variant?: 'soft' | 'outline';\n title?: React.ReactNode;\n /** Custom icon, or `false` to hide it. */\n icon?: React.ReactNode | false;\n /** Buttons rendered after the message. */\n actions?: React.ReactNode;\n /** Shows a dismiss button. */\n onDismiss?: () => void;\n dismissLabel?: string;\n}\n\nconst defaultIcons: Record<AlertTone, React.ReactNode> = {\n info: <InfoIcon />,\n neutral: <InfoIcon />,\n success: <CircleCheckIcon />,\n warning: <TriangleAlertIcon />,\n danger: <CircleXIcon />,\n};\n\n/** Inline message for page- or section-level feedback. */\nexport function Alert({\n tone = 'info',\n variant = 'soft',\n title,\n icon,\n actions,\n onDismiss,\n dismissLabel = 'Dismiss',\n className,\n children,\n ref,\n ...props\n}: AlertProps) {\n const urgent = tone === 'danger' || tone === 'warning';\n const iconNode = icon === false ? null : (icon ?? defaultIcons[tone]);\n return (\n <div\n ref={ref}\n role={urgent ? 'alert' : 'status'}\n className={cx('oui-alert', className)}\n data-tone={tone}\n data-variant={variant}\n {...props}\n >\n {iconNode && <span className=\"oui-alert__icon\">{iconNode}</span>}\n <div className=\"oui-alert__body\">\n {title && <p className=\"oui-alert__title\">{title}</p>}\n {children && <div className=\"oui-alert__message\">{children}</div>}\n {actions && <div className=\"oui-alert__actions\">{actions}</div>}\n </div>\n {onDismiss && (\n <IconButton className=\"oui-alert__dismiss\" size=\"sm\" aria-label={dismissLabel} onClick={onDismiss}>\n <XIcon />\n </IconButton>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"Alert.js","names":["React","cx","CircleCheckIcon","CircleXIcon","InfoIcon","TriangleAlertIcon","XIcon","IconButton","AlertTone","AlertProps","Omit","HTMLAttributes","HTMLDivElement","ref","Ref","tone","variant","title","ReactNode","icon","actions","onDismiss","dismissLabel","defaultIcons","Record","info","neutral","success","warning","danger","Alert","t0","$","_c","children","className","props","t1","t2","t3","undefined","urgent","iconNode","t4","t5","t6","t7","t8","t9","t10","t11","t12","_c"],"sources":["../../../src/components/alert/Alert.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cx } from '../../utils/cx';\nimport { CircleCheckIcon, CircleXIcon, InfoIcon, TriangleAlertIcon, XIcon } from '../../icons';\nimport { IconButton } from '../button/Button';\n\nexport type AlertTone = 'info' | 'success' | 'warning' | 'danger' | 'neutral';\n\nexport interface AlertProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {\n /** Ref to the alert element. */\n ref?: React.Ref<HTMLDivElement>;\n /** Semantic color and default icon. `danger` and `warning` announce as an alert role. */\n tone?: AlertTone;\n /** `soft` (tinted, default) or `outline`. */\n variant?: 'soft' | 'outline';\n /** Bold first line above the message. */\n title?: React.ReactNode;\n /** Custom icon, or `false` to hide it. */\n icon?: React.ReactNode | false;\n /** Buttons rendered after the message. */\n actions?: React.ReactNode;\n /** Shows a dismiss button. */\n onDismiss?: () => void;\n /** Accessible name of the dismiss button. */\n dismissLabel?: string;\n}\n\nconst defaultIcons: Record<AlertTone, React.ReactNode> = {\n info: <InfoIcon />,\n neutral: <InfoIcon />,\n success: <CircleCheckIcon />,\n warning: <TriangleAlertIcon />,\n danger: <CircleXIcon />,\n};\n\n/** Inline message for page- or section-level feedback. */\nexport function Alert({\n tone = 'info',\n variant = 'soft',\n title,\n icon,\n actions,\n onDismiss,\n dismissLabel = 'Dismiss',\n className,\n children,\n ref,\n ...props\n}: AlertProps) {\n const urgent = tone === 'danger' || tone === 'warning';\n const iconNode = icon === false ? null : (icon ?? defaultIcons[tone]);\n return (\n <div\n ref={ref}\n role={urgent ? 'alert' : 'status'}\n className={cx('oui-alert', className)}\n data-tone={tone}\n data-variant={variant}\n {...props}\n >\n {iconNode && <span className=\"oui-alert__icon\">{iconNode}</span>}\n <div className=\"oui-alert__body\">\n {title && <p className=\"oui-alert__title\">{title}</p>}\n {children && <div className=\"oui-alert__message\">{children}</div>}\n {actions && <div className=\"oui-alert__actions\">{actions}</div>}\n </div>\n {onDismiss && (\n <IconButton className=\"oui-alert__dismiss\" size=\"sm\" aria-label={dismissLabel} onClick={onDismiss}>\n <XIcon />\n </IconButton>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;AA0BA,IAAMuB,eAAmD;CACvDE,MAAM,oBAAC,UAAD,CAAS,CAAA;CACfC,SAAS,oBAAC,UAAD,CAAS,CAAA;CAClBC,SAAS,oBAAC,iBAAD,CAAgB,CAAA;CACzBC,SAAS,oBAAC,mBAAD,CAAkB,CAAA;CAC3BC,QAAQ,oBAAC,aAAD,CAAY,CAAA;AACtB;;AAGA,SAAOC,MAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAb;CAAA,IAAAc;CAAA,IAAAC;CAAA,IAAAhB;CAAA,IAAAE;CAAA,IAAAe;CAAA,IAAAvB;CAAA,IAAAwB;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAtB;CAAA,IAAAe,EAAA,OAAAD,IAAA;EAAe,CAAA,CAAAhB,MAAAsB,IAAArB,SAAAsB,IAAArB,OAAAE,MAAAC,SAAAC,WAAAC,cAAAiB,IAAAJ,WAAAD,UAAArB,KAAA,GAAAuB,SAAAL;EAYTC,EAAA,KAAAD;EAAAC,EAAA,KAAAZ;EAAAY,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAb;EAAAa,EAAA,KAAAX;EAAAW,EAAA,KAAAI;EAAAJ,EAAA,KAAAnB;EAAAmB,EAAA,KAAAK;EAAAL,EAAA,KAAAM;EAAAN,EAAA,MAAAO;EAAAP,EAAA,MAAAf;CAAA,OAAA;EAAAG,UAAAY,EAAA;EAAAE,WAAAF,EAAA;EAAAG,YAAAH,EAAA;EAA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AAAb,EAAA,MAAAjB;EAAAiB,EAAA,MAAAhB;EAAAgB,EAAA,MAAAmB;CAAA,OAAAA,MAAAnB,EAAA;CAAA,OAnBNmB;AAmBM"}
|
|
@@ -13,14 +13,21 @@ export interface NavbarProps extends useRender.ComponentProps<'nav', NavbarState
|
|
|
13
13
|
collapsible?: boolean;
|
|
14
14
|
/** Controlled collapsed state. */
|
|
15
15
|
collapsed?: boolean;
|
|
16
|
+
/** Initial collapsed state when uncontrolled. */
|
|
16
17
|
defaultCollapsed?: boolean;
|
|
18
|
+
/** Called when the user collapses or expands the navbar. */
|
|
17
19
|
onCollapsedChange?: (collapsed: boolean) => void;
|
|
18
20
|
/** Temporarily opens a collapsed navbar while the mouse is over it. Defaults to `true`. */
|
|
19
21
|
expandOnHover?: boolean;
|
|
20
22
|
/** Accessible names for the icon-only toggle. */
|
|
21
23
|
collapseLabel?: string;
|
|
24
|
+
/** Accessible name of the toggle while collapsed. */
|
|
22
25
|
expandLabel?: string;
|
|
23
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Collapsible side navigation. Use inside `AppShell`. Compose with `NavbarHeader` (`NavbarBrand`),
|
|
29
|
+
* `NavbarSection` (`NavbarSectionLabel`, `NavbarItem`) and `NavbarFooter`.
|
|
30
|
+
*/
|
|
24
31
|
export declare function Navbar({ variant, collapsible, collapsed: collapsedProp, defaultCollapsed, onCollapsedChange, expandOnHover, collapseLabel, expandLabel, render, children, ref, ...props }: NavbarProps): React.JSX.Element;
|
|
25
32
|
export declare const NavbarHeader: {
|
|
26
33
|
(props: import("../../utils/primitive").PrimitiveProps<"div">): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
@@ -39,27 +46,75 @@ export declare const NavbarSectionLabel: {
|
|
|
39
46
|
displayName: string;
|
|
40
47
|
};
|
|
41
48
|
export interface NavbarBrandProps extends Omit<useRender.ComponentProps<'div'>, 'title'> {
|
|
49
|
+
/** Logo or icon shown before the title; stays visible when the navbar is collapsed. */
|
|
42
50
|
logo?: React.ReactNode;
|
|
51
|
+
/** Product or organization name. */
|
|
43
52
|
title: React.ReactNode;
|
|
53
|
+
/** Smaller line under the title. */
|
|
44
54
|
subtitle?: React.ReactNode;
|
|
45
55
|
}
|
|
56
|
+
/** Logo, title and subtitle block for the top of a `Navbar`. */
|
|
46
57
|
export declare function NavbarBrand({ logo, title, subtitle, render, ref, ...props }: NavbarBrandProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
47
58
|
export type NavbarItemState = {
|
|
48
59
|
active: boolean;
|
|
49
60
|
};
|
|
50
61
|
export interface NavbarItemProps extends useRender.ComponentProps<'a', NavbarItemState> {
|
|
62
|
+
/** Icon shown before the label; it stays visible when the navbar is collapsed to a rail. Not shown inside a `NavbarGroup`. */
|
|
51
63
|
icon?: React.ReactNode;
|
|
52
|
-
/** Marks the current page (sets aria-current). */
|
|
64
|
+
/** Marks the current page (sets aria-current). Also opens the surrounding `NavbarGroup`. */
|
|
53
65
|
active?: boolean;
|
|
54
66
|
/** Trailing content such as a count badge. */
|
|
55
67
|
badge?: React.ReactNode;
|
|
68
|
+
/**
|
|
69
|
+
* Also shows the item in the `AppShell` mobile tab bar (icon and label). Pin up to four items; the
|
|
70
|
+
* first four in navbar order are used. Has no effect outside an `AppShell`.
|
|
71
|
+
*/
|
|
72
|
+
pinned?: boolean;
|
|
56
73
|
}
|
|
57
74
|
/**
|
|
58
75
|
* Navigation link. Renders an `<a>`; use `render={<Link to="…" />}` for a
|
|
59
|
-
* router link or `render={<button />}` for an action.
|
|
76
|
+
* router link or `render={<button />}` for an action. Inside a `NavbarGroup` it becomes an indented sub-link.
|
|
77
|
+
*/
|
|
78
|
+
export declare function NavbarItem({ icon, active, badge, pinned, render, children, ref, ...props }: NavbarItemProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
79
|
+
export interface NavbarGroupProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
80
|
+
/** Ref to the group's root element. */
|
|
81
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
82
|
+
/** Text of the parent row. A string also becomes its tooltip on the collapsed rail. */
|
|
83
|
+
label: React.ReactNode;
|
|
84
|
+
/** Icon of the parent row; it stays visible when the navbar is collapsed to a rail. */
|
|
85
|
+
icon?: React.ReactNode;
|
|
86
|
+
/** Trailing content of the parent row, such as a count badge. */
|
|
87
|
+
badge?: React.ReactNode;
|
|
88
|
+
/** Controlled open state. Takes over from the automatic opening on an active child. */
|
|
89
|
+
open?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Initial open state when uncontrolled. Whenever a child item becomes `active`, the group opens.
|
|
92
|
+
* @default true when a child item is active
|
|
93
|
+
*/
|
|
94
|
+
defaultOpen?: boolean;
|
|
95
|
+
/** Called when the user opens or closes the group. */
|
|
96
|
+
onOpenChange?: (open: boolean) => void;
|
|
97
|
+
/** Sub-links: `NavbarItem` elements (directly or in fragments), shown indented and without icons. */
|
|
98
|
+
children?: React.ReactNode;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Expandable parent row in a `Navbar` with nested `NavbarItem` sub-links. Place it in a `NavbarSection`
|
|
102
|
+
* next to other items. On a collapsed rail the sub-links are hidden and the parent shows as active when
|
|
103
|
+
* one of them is; the hover peek shows the full tree.
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* <NavbarSection>
|
|
107
|
+
* <NavbarGroup icon={<Truck />} label="Fleet">
|
|
108
|
+
* <NavbarItem href="/fleet/vehicles" active>Vehicles</NavbarItem>
|
|
109
|
+
* <NavbarItem href="/fleet/drivers">Drivers</NavbarItem>
|
|
110
|
+
* </NavbarGroup>
|
|
111
|
+
* </NavbarSection>
|
|
60
112
|
*/
|
|
61
|
-
export declare function
|
|
113
|
+
export declare function NavbarGroup({ label, icon, badge, open: openProp, defaultOpen, onOpenChange, className, children, ref, ...props }: NavbarGroupProps): React.JSX.Element;
|
|
114
|
+
export type MobileNavPosition = 'bottom' | 'top';
|
|
115
|
+
export type MoreTabPosition = 'start' | 'end';
|
|
62
116
|
export interface AppShellProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
117
|
+
/** Ref to the shell's root element. */
|
|
63
118
|
ref?: React.Ref<HTMLDivElement>;
|
|
64
119
|
/** Navbar content (usually a `<Navbar>`). Rendered in a drawer on small screens. */
|
|
65
120
|
navbar: React.ReactNode;
|
|
@@ -67,30 +122,66 @@ export interface AppShellProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
67
122
|
mobileBrand?: React.ReactNode;
|
|
68
123
|
/** Extra content on the right of the mobile top bar. */
|
|
69
124
|
mobileActions?: React.ReactNode;
|
|
125
|
+
/**
|
|
126
|
+
* Where small screens show the tab bar of pinned `NavbarItem`s: below or above the main area. Both look
|
|
127
|
+
* the same; the "More" slot (see `moreTabPosition`) opens the navbar drawer. The top bar with `mobileBrand` and
|
|
128
|
+
* `mobileActions` only appears when one of them is set. Without pinned items, a top bar with a menu
|
|
129
|
+
* button is shown instead.
|
|
130
|
+
*/
|
|
131
|
+
mobileNavPosition?: MobileNavPosition;
|
|
132
|
+
/** Accessible name of the button that opens the navigation drawer on small screens. */
|
|
70
133
|
menuLabel?: string;
|
|
134
|
+
/** Label of the tab-bar slot that opens the navigation drawer. */
|
|
135
|
+
moreLabel?: string;
|
|
136
|
+
/** Whether the "More" slot comes before or after the pinned items in the tab bar. */
|
|
137
|
+
moreTabPosition?: MoreTabPosition;
|
|
71
138
|
/** Props for the scrolling `<main>` element. */
|
|
72
139
|
mainProps?: React.HTMLAttributes<HTMLElement>;
|
|
73
140
|
}
|
|
74
141
|
/**
|
|
75
142
|
* Full-height layout with a fixed navbar and an internally scrolling main
|
|
76
|
-
* area. Below 900px the navbar moves into a slide-in drawer
|
|
143
|
+
* area. Below 900px the navbar moves into a slide-in drawer, and `NavbarItem`s marked `pinned` show in a
|
|
144
|
+
* tab bar (see `mobileNavPosition`).
|
|
77
145
|
* Customize width with `--oui-navbar-width` and `--oui-navbar-collapsed-width`.
|
|
146
|
+
*
|
|
147
|
+
* @example
|
|
148
|
+
* <AppShell
|
|
149
|
+
* mobileBrand="OptiControl"
|
|
150
|
+
* navbar={
|
|
151
|
+
* <Navbar>
|
|
152
|
+
* <NavbarSection>
|
|
153
|
+
* <NavbarItem href="/" icon={<Home />} active pinned>Overview</NavbarItem>
|
|
154
|
+
* <NavbarItem href="/fleet" icon={<Truck />} pinned>Fleet</NavbarItem>
|
|
155
|
+
* </NavbarSection>
|
|
156
|
+
* </Navbar>
|
|
157
|
+
* }
|
|
158
|
+
* >
|
|
159
|
+
* <PageHeader title="Overview" />
|
|
160
|
+
* </AppShell>
|
|
78
161
|
*/
|
|
79
|
-
export declare function AppShell({ navbar, mobileBrand, mobileActions, menuLabel, mainProps, className, children, ref, ...props }: AppShellProps): React.JSX.Element;
|
|
162
|
+
export declare function AppShell({ navbar, mobileBrand, mobileActions, mobileNavPosition, menuLabel, moreLabel, moreTabPosition, mainProps, className, children, ref, ...props }: AppShellProps): React.JSX.Element;
|
|
80
163
|
export interface PageHeaderProps extends Omit<React.HTMLAttributes<HTMLElement>, 'title'> {
|
|
164
|
+
/** Ref to the `<header>` element. */
|
|
81
165
|
ref?: React.Ref<HTMLElement>;
|
|
82
166
|
/** Trail shown above the title, usually `<Breadcrumbs>`. */
|
|
83
167
|
breadcrumbs?: React.ReactNode;
|
|
168
|
+
/** Small label above the title. */
|
|
84
169
|
eyebrow?: React.ReactNode;
|
|
170
|
+
/** Page title, rendered as the page `<h1>`. */
|
|
85
171
|
title: React.ReactNode;
|
|
172
|
+
/** Supporting text under the title. */
|
|
86
173
|
description?: React.ReactNode;
|
|
174
|
+
/** Buttons or controls aligned to the right of the title. */
|
|
87
175
|
actions?: React.ReactNode;
|
|
88
176
|
}
|
|
177
|
+
/** Page title block with optional breadcrumbs, eyebrow, description and actions. */
|
|
89
178
|
export declare function PageHeader({ breadcrumbs, eyebrow, title, description, actions, className, ref, ...props }: PageHeaderProps): React.JSX.Element;
|
|
90
179
|
export interface GridProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
180
|
+
/** Ref to the grid element. */
|
|
91
181
|
ref?: React.Ref<HTMLDivElement>;
|
|
92
182
|
/** Columns on wide screens; collapses to 2 below 1200px (for 4+) and 1 below 900px. */
|
|
93
183
|
columns?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
184
|
+
/** Space between grid cells. */
|
|
94
185
|
gap?: 'sm' | 'md' | 'lg';
|
|
95
186
|
}
|
|
96
187
|
/** Responsive dashboard grid. */
|