neba 1.9.0 → 1.11.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 +35 -5
- package/dist/components/accordion/Accordion.js +1 -1
- package/dist/components/alert/Alert.js +1 -1
- package/dist/components/anchor/Anchor.js +1 -1
- package/dist/components/animate-lighting/AnimateLighting.js +1 -1
- package/dist/components/app-logo/AppLogo.js +1 -1
- package/dist/components/aspect-ratio/AspectRatio.js +1 -1
- package/dist/components/avatar/Avatar.js +1 -1
- package/dist/components/avatar-group/AvatarGroup.js +1 -1
- package/dist/components/badge/Badge.js +1 -1
- package/dist/components/bar-chart/BarChart.d.ts +1 -1
- package/dist/components/bar-chart/BarChart.js +1 -1
- package/dist/components/blockquote/Blockquote.js +1 -1
- package/dist/components/bottom-navigation/BottomNavigation.js +1 -1
- package/dist/components/box/Box.js +1 -1
- package/dist/components/breadcrumb/Breadcrumb.js +1 -1
- package/dist/components/button/Button.js +1 -1
- package/dist/components/button-group/ButtonGroup.js +1 -1
- package/dist/components/calendar/Calendar.d.ts +72 -0
- package/dist/components/calendar/Calendar.js +1 -0
- package/dist/components/calendar/index.d.ts +2 -0
- package/dist/components/calendar/index.js +1 -0
- package/dist/components/card/Card.js +1 -1
- package/dist/components/carousel/Carousel.js +1 -1
- package/dist/components/chat-bubble/ChatBubble.js +1 -1
- package/dist/components/checkbox/Checkbox.d.ts +13 -1
- package/dist/components/checkbox/Checkbox.js +1 -1
- package/dist/components/chip/Chip.js +1 -1
- package/dist/components/code-block/CodeBlock.js +1 -1
- package/dist/components/collapsible/Collapsible.js +1 -1
- package/dist/components/color-picker/ColorPicker.js +1 -1
- package/dist/components/combobox/Combobox.d.ts +29 -2
- package/dist/components/combobox/Combobox.js +1 -1
- package/dist/components/command-palette/CommandPalette.d.ts +19 -2
- package/dist/components/command-palette/CommandPalette.js +1 -1
- package/dist/components/confirm/Confirm.d.ts +83 -0
- package/dist/components/confirm/Confirm.js +1 -0
- package/dist/components/confirm/index.d.ts +2 -0
- package/dist/components/confirm/index.js +1 -0
- package/dist/components/container/Container.js +1 -1
- package/dist/components/data-list/DataList.js +1 -1
- package/dist/components/data-table/DataTable.d.ts +104 -1
- package/dist/components/data-table/DataTable.js +1 -1
- package/dist/components/date-picker/DatePicker.d.ts +40 -8
- package/dist/components/date-picker/DatePicker.js +1 -1
- package/dist/components/date-range-picker/DateRangePicker.js +1 -1
- package/dist/components/date-time-picker/DateTimePicker.js +1 -1
- package/dist/components/dialog/Dialog.d.ts +19 -2
- package/dist/components/dialog/Dialog.js +1 -1
- package/dist/components/divider/Divider.js +1 -1
- package/dist/components/drawer/Drawer.d.ts +1 -1
- package/dist/components/drawer/Drawer.js +1 -1
- package/dist/components/empty/Empty.js +1 -1
- package/dist/components/file-picker/FilePicker.js +1 -1
- package/dist/components/floating-action-button/FloatingActionButton.js +1 -1
- package/dist/components/floating-bottom-navigation/FloatingBottomNavigation.js +1 -1
- package/dist/components/footer/Footer.js +1 -1
- package/dist/components/gauge-chart/GaugeChart.d.ts +1 -1
- package/dist/components/gauge-chart/GaugeChart.js +1 -1
- package/dist/components/grid-container/GridContainer.js +1 -1
- package/dist/components/header/Header.js +1 -1
- package/dist/components/heatmap-chart/HeatmapChart.d.ts +1 -1
- package/dist/components/heatmap-chart/HeatmapChart.js +1 -1
- package/dist/components/highlight/Highlight.js +1 -1
- package/dist/components/hover-card/HoverCard.d.ts +1 -1
- package/dist/components/hover-card/HoverCard.js +1 -1
- package/dist/components/how-to-steps/HowToSteps.js +1 -1
- package/dist/components/image/Image.d.ts +70 -0
- package/dist/components/image/Image.js +1 -0
- package/dist/components/image/index.d.ts +2 -0
- package/dist/components/image/index.js +1 -0
- package/dist/components/list/List.js +1 -1
- package/dist/components/menubar/Menubar.js +1 -1
- package/dist/components/meter/Meter.js +1 -1
- package/dist/components/mockup/Mockup.js +1 -1
- package/dist/components/number-field/NumberField.d.ts +27 -2
- package/dist/components/number-field/NumberField.js +1 -1
- package/dist/components/otp-field/OtpField.js +1 -1
- package/dist/components/overlay/Overlay.d.ts +1 -1
- package/dist/components/overlay/Overlay.js +1 -1
- package/dist/components/page-layout/PageLayout.js +1 -1
- package/dist/components/pagination/Pagination.js +1 -1
- package/dist/components/panes/Panes.js +1 -1
- package/dist/components/pie-chart/PieChart.d.ts +1 -1
- package/dist/components/pie-chart/PieChart.js +1 -1
- package/dist/components/pill/Pill.js +1 -1
- package/dist/components/popconfirm/Popconfirm.d.ts +71 -0
- package/dist/components/popconfirm/Popconfirm.js +1 -0
- package/dist/components/popconfirm/index.d.ts +2 -0
- package/dist/components/popconfirm/index.js +1 -0
- package/dist/components/popover/Popover.d.ts +1 -1
- package/dist/components/popover/Popover.js +1 -1
- package/dist/components/portal/Portal.d.ts +48 -0
- package/dist/components/portal/Portal.js +1 -0
- package/dist/components/portal/index.d.ts +2 -0
- package/dist/components/portal/index.js +1 -0
- package/dist/components/progress-box/ProgressBox.js +1 -1
- package/dist/components/progress-circular/ProgressCircular.js +1 -1
- package/dist/components/progress-linear/ProgressLinear.js +1 -1
- package/dist/components/provider/NebaProvider.d.ts +99 -0
- package/dist/components/provider/NebaProvider.js +1 -0
- package/dist/components/provider/index.d.ts +3 -0
- package/dist/components/provider/index.js +1 -0
- package/dist/components/radio-group/RadioGroup.d.ts +22 -1
- package/dist/components/radio-group/RadioGroup.js +1 -1
- package/dist/components/rating/Rating.js +1 -1
- package/dist/components/scatter-chart/ScatterChart.d.ts +1 -1
- package/dist/components/scatter-chart/ScatterChart.js +1 -1
- package/dist/components/scroll-area/ScrollArea.js +1 -1
- package/dist/components/scroll-zone/ScrollZone.js +1 -1
- package/dist/components/select/Select.d.ts +16 -1
- package/dist/components/select/Select.js +1 -1
- package/dist/components/shortcut/Shortcut.d.ts +2 -1
- package/dist/components/shortcut/Shortcut.js +1 -1
- package/dist/components/sidebar/Sidebar.js +1 -1
- package/dist/components/sidebar/SidebarTrigger.js +1 -1
- package/dist/components/skeleton/Skeleton.js +1 -1
- package/dist/components/slider/Slider.js +1 -1
- package/dist/components/sparkline/Sparkline.js +1 -1
- package/dist/components/spoiler/Spoiler.js +1 -1
- package/dist/components/statistic/Statistic.js +1 -1
- package/dist/components/switch/Switch.d.ts +13 -1
- package/dist/components/switch/Switch.js +1 -1
- package/dist/components/table/Table.d.ts +21 -2
- package/dist/components/table/Table.js +1 -1
- package/dist/components/text-field/TextField.d.ts +27 -1
- package/dist/components/text-field/TextField.js +1 -1
- package/dist/components/text-link/TextLink.js +1 -1
- package/dist/components/time-picker/TimePicker.js +1 -1
- package/dist/components/timeline-chart/TimelineChart.d.ts +1 -1
- package/dist/components/timeline-chart/TimelineChart.js +1 -1
- package/dist/components/toast/Toast.d.ts +17 -2
- package/dist/components/toast/Toast.js +1 -1
- package/dist/components/toggle/Toggle.js +1 -1
- package/dist/components/toggle-group/ToggleGroup.js +1 -1
- package/dist/components/toolbar/Toolbar.js +1 -1
- package/dist/components/tooltip/Tooltip.d.ts +1 -1
- package/dist/components/tooltip/Tooltip.js +1 -1
- package/dist/components/tour/Tour.d.ts +17 -2
- package/dist/components/tour/Tour.js +1 -1
- package/dist/components/transfer/Transfer.js +1 -1
- package/dist/components/tree-select/TreeSelect.d.ts +88 -0
- package/dist/components/tree-select/TreeSelect.js +1 -0
- package/dist/components/tree-select/index.d.ts +2 -0
- package/dist/components/tree-select/index.js +1 -0
- package/dist/components/tree-view/TreeView.js +1 -1
- package/dist/components/visually-hidden/VisuallyHidden.d.ts +37 -0
- package/dist/components/visually-hidden/VisuallyHidden.js +1 -0
- package/dist/components/visually-hidden/index.d.ts +2 -0
- package/dist/components/visually-hidden/index.js +1 -0
- package/dist/components/window-pane/WindowPane.js +1 -1
- package/dist/hooks/index.d.ts +10 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/useDisclosure.d.ts +21 -0
- package/dist/hooks/useDisclosure.js +1 -0
- package/dist/hooks/useElementSize.d.ts +23 -0
- package/dist/hooks/useElementSize.js +1 -0
- package/dist/hooks/useMediaQuery.d.ts +27 -0
- package/dist/hooks/useMediaQuery.js +1 -0
- package/dist/hooks/useOnScreen.d.ts +24 -0
- package/dist/hooks/useOnScreen.js +1 -0
- package/dist/hooks/useShortcut.d.ts +34 -0
- package/dist/hooks/useShortcut.js +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +1 -1
- package/dist/internal/calendar.d.ts +31 -5
- package/dist/internal/calendar.js +1 -1
- package/dist/internal/csv.d.ts +40 -0
- package/dist/internal/csv.js +1 -0
- package/dist/internal/date.d.ts +39 -1
- package/dist/internal/date.js +1 -1
- package/dist/internal/defaults.d.ts +46 -0
- package/dist/internal/defaults.js +1 -0
- package/dist/internal/i18n.d.ts +23 -0
- package/dist/internal/i18n.js +1 -1
- package/dist/internal/keys.d.ts +92 -0
- package/dist/internal/keys.js +1 -0
- package/dist/internal/media.d.ts +27 -0
- package/dist/internal/media.js +1 -1
- package/dist/internal/page-layout.d.ts +7 -0
- package/dist/internal/page-layout.js +1 -1
- package/dist/internal/picker.d.ts +7 -1
- package/dist/internal/picker.js +1 -1
- package/dist/locales/ar.js +1 -1
- package/dist/locales/de.js +1 -1
- package/dist/locales/es.js +1 -1
- package/dist/locales/fr.js +1 -1
- package/dist/locales/hi.js +1 -1
- package/dist/locales/id.js +1 -1
- package/dist/locales/it.js +1 -1
- package/dist/locales/ja.js +1 -1
- package/dist/locales/ko.js +1 -1
- package/dist/locales/nl.js +1 -1
- package/dist/locales/pl.js +1 -1
- package/dist/locales/pt.js +1 -1
- package/dist/locales/ru.js +1 -1
- package/dist/locales/th.js +1 -1
- package/dist/locales/tr.js +1 -1
- package/dist/locales/vi.js +1 -1
- package/dist/locales/zh-hans.js +1 -1
- package/dist/locales/zh-hant.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/types.d.ts +73 -0
- package/package.json +6 -1
package/dist/types.d.ts
CHANGED
|
@@ -72,6 +72,20 @@ export type NebaCorner = 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end'
|
|
|
72
72
|
* The pickers default it from the locale, so it is rarely written down at all.
|
|
73
73
|
*/
|
|
74
74
|
export type NebaWeekday = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
75
|
+
/**
|
|
76
|
+
* Which unit a date picker is actually asking for.
|
|
77
|
+
*
|
|
78
|
+
* A calendar already draws three grids — days, months, years — and until now
|
|
79
|
+
* two of them were only a way of reaching the third. This says which one the
|
|
80
|
+
* reader is allowed to stop on, and therefore what the value stands for: one
|
|
81
|
+
* day, one whole month, one whole year.
|
|
82
|
+
*
|
|
83
|
+
* A coarser granularity is not a different value type. The value stays a `Date`
|
|
84
|
+
* and is normalised to the first instant of the unit chosen — the 1st of the
|
|
85
|
+
* month, the 1st of January — because a month picker that reported the 15th
|
|
86
|
+
* would be reporting a day nobody chose.
|
|
87
|
+
*/
|
|
88
|
+
export type NebaDateGranularity = 'day' | 'month' | 'year';
|
|
75
89
|
/**
|
|
76
90
|
* The viewport widths the layout components branch on, smallest first.
|
|
77
91
|
*
|
|
@@ -482,3 +496,62 @@ export interface NebaStyleProps {
|
|
|
482
496
|
/** @default 'default' */
|
|
483
497
|
density?: NebaDensity;
|
|
484
498
|
}
|
|
499
|
+
/**
|
|
500
|
+
* Class names for the parts of a component that its `className` cannot reach.
|
|
501
|
+
*
|
|
502
|
+
* A component that draws one element needs none of this: `className` lands on
|
|
503
|
+
* that element and there is nothing else to say. A component that draws six —
|
|
504
|
+
* a field with a label, a shell, a control and two lines of text under it — has
|
|
505
|
+
* five parts a caller can see, can want to change, and has no way to name. That
|
|
506
|
+
* is what this is for, and it is the whole of what it is for.
|
|
507
|
+
*
|
|
508
|
+
* **There is never a `root` key.** `className` is the root, on every component
|
|
509
|
+
* in the library, and a `classNames.root` beside it would be a second spelling
|
|
510
|
+
* of an idea that already has one. The rule that keeps `size` meaning one thing
|
|
511
|
+
* applies here too.
|
|
512
|
+
*
|
|
513
|
+
* A slot name is a promise about the element behind it, so the union each
|
|
514
|
+
* component declares is deliberately short. Only parts that are *structurally*
|
|
515
|
+
* there — a label is a label whatever the field is — get a name; the wrappers
|
|
516
|
+
* that exist to hold a flex direction do not, because naming one freezes a
|
|
517
|
+
* layout decision into the public API.
|
|
518
|
+
*/
|
|
519
|
+
export type NebaSlots<Slot extends string> = Partial<Record<Slot, string>>;
|
|
520
|
+
/**
|
|
521
|
+
* Key combinations a control acts on, as a map from the combination to what it
|
|
522
|
+
* does.
|
|
523
|
+
*
|
|
524
|
+
* The combinations are written the way [Shortcut](../components/shortcut) draws
|
|
525
|
+
* them — `'Enter'`, `'Mod+Enter'`, `'Escape'` — and that is the point rather
|
|
526
|
+
* than a convenience: a key a product *shows* a reader and a key it *binds* have
|
|
527
|
+
* to be spelled the same, or the label on the screen is a claim nobody checked.
|
|
528
|
+
* `Mod` is Command on a Mac and Control everywhere else.
|
|
529
|
+
*
|
|
530
|
+
* A map rather than an `onShortcut(combination, event)`, because a caller with
|
|
531
|
+
* three shortcuts wants three functions and not a `switch`. The modifiers are
|
|
532
|
+
* matched exactly, so `Enter` and `Mod+Enter` are two entries that never both
|
|
533
|
+
* fire.
|
|
534
|
+
*
|
|
535
|
+
* It is not a replacement for `onKeyDown`, which still sees every keystroke.
|
|
536
|
+
* This is for the case a component cannot express any other way: a key the
|
|
537
|
+
* control itself already has an opinion about.
|
|
538
|
+
*/
|
|
539
|
+
export type NebaShortcuts<E extends Element = HTMLElement> = Record<string, (event: React.KeyboardEvent<E>) => void>;
|
|
540
|
+
/**
|
|
541
|
+
* The parts every field-shaped component draws, and the reason they are one
|
|
542
|
+
* type: a `classNames.label` has to mean the label on a TextField, a Select, a
|
|
543
|
+
* Checkbox and a RadioGroup alike, exactly as a `size` of `md` means one height
|
|
544
|
+
* everywhere.
|
|
545
|
+
*
|
|
546
|
+
* - `label` — the field's own name, above it or beside it.
|
|
547
|
+
* - `control` — the thing the reader actually operates: the `<input>`, the
|
|
548
|
+
* trigger, the tick, the track.
|
|
549
|
+
* - `description` — the helper line under it.
|
|
550
|
+
* - `error` — the message that replaces it when the field is invalid.
|
|
551
|
+
*
|
|
552
|
+
* Four rather than more, because these four are the ones that exist on all of
|
|
553
|
+
* them. A shell around the control, a popup, a chip — those are real parts, but
|
|
554
|
+
* only some fields have them, and a slot offered on a component that cannot
|
|
555
|
+
* draw it is a slot that does nothing.
|
|
556
|
+
*/
|
|
557
|
+
export type NebaFieldSlot = 'label' | 'control' | 'description' | 'error';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "neba",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"description": "A comprehensive React UI component library — buttons, fields, menus, dialogs, tables and much more — accessible and themeable, sharing one prop vocabulary and a translucent acrylic design language. ESM only, types included, dark mode built in.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -50,6 +50,11 @@
|
|
|
50
50
|
"module": "./dist/types.js",
|
|
51
51
|
"default": "./dist/types.js"
|
|
52
52
|
},
|
|
53
|
+
"./hooks": {
|
|
54
|
+
"types": "./dist/hooks/index.d.ts",
|
|
55
|
+
"module": "./dist/hooks/index.js",
|
|
56
|
+
"default": "./dist/hooks/index.js"
|
|
57
|
+
},
|
|
53
58
|
"./locales": {
|
|
54
59
|
"types": "./dist/locales/index.d.ts",
|
|
55
60
|
"module": "./dist/locales/index.js",
|