neba 1.11.0 → 1.13.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/LICENSE +1 -1
- package/README.md +43 -41
- package/dist/components/accordion/Accordion.d.ts +18 -0
- package/dist/components/accordion/Accordion.js +1 -1
- package/dist/components/anchor/Anchor.js +1 -1
- package/dist/components/animate-appear/AnimateAppear.d.ts +2 -13
- package/dist/components/animate-appear/AnimateAppear.js +1 -1
- package/dist/components/animate-blink/AnimateBlink.d.ts +2 -2
- package/dist/components/animate-blink/AnimateBlink.js +1 -1
- package/dist/components/animate-counter/AnimateCounter.d.ts +45 -0
- package/dist/components/animate-counter/AnimateCounter.js +1 -0
- package/dist/components/animate-counter/index.d.ts +1 -0
- package/dist/components/animate-counter/index.js +1 -0
- package/dist/components/animate-fade/AnimateFade.d.ts +2 -2
- package/dist/components/animate-fade/AnimateFade.js +1 -1
- package/dist/components/animate-float/AnimateFloat.d.ts +35 -0
- package/dist/components/animate-float/AnimateFloat.js +1 -0
- package/dist/components/animate-float/index.d.ts +1 -0
- package/dist/components/animate-float/index.js +1 -0
- package/dist/components/animate-grow/AnimateGrow.d.ts +2 -2
- package/dist/components/animate-grow/AnimateGrow.js +1 -1
- package/dist/components/animate-marquee/AnimateMarquee.d.ts +5 -3
- package/dist/components/animate-marquee/AnimateMarquee.js +1 -1
- package/dist/components/animate-reveal/AnimateReveal.d.ts +41 -0
- package/dist/components/animate-reveal/AnimateReveal.js +1 -0
- package/dist/components/animate-reveal/index.d.ts +1 -0
- package/dist/components/animate-reveal/index.js +1 -0
- package/dist/components/animate-rotate/AnimateRotate.d.ts +2 -2
- package/dist/components/animate-rotate/AnimateRotate.js +1 -1
- package/dist/components/animate-scramble/AnimateScramble.d.ts +48 -0
- package/dist/components/animate-scramble/AnimateScramble.js +1 -0
- package/dist/components/animate-scramble/index.d.ts +1 -0
- package/dist/components/animate-scramble/index.js +1 -0
- package/dist/components/animate-shake/AnimateShake.d.ts +39 -0
- package/dist/components/animate-shake/AnimateShake.js +1 -0
- package/dist/components/animate-shake/index.d.ts +1 -0
- package/dist/components/animate-shake/index.js +1 -0
- package/dist/components/animate-slide/AnimateSlide.d.ts +2 -2
- package/dist/components/animate-slide/AnimateSlide.js +1 -1
- package/dist/components/animate-split/AnimateSplit.d.ts +61 -0
- package/dist/components/animate-split/AnimateSplit.js +1 -0
- package/dist/components/animate-split/index.d.ts +1 -0
- package/dist/components/animate-split/index.js +1 -0
- package/dist/components/animate-typing/AnimateTyping.js +1 -1
- package/dist/components/animate-zoom/AnimateZoom.d.ts +2 -2
- package/dist/components/animate-zoom/AnimateZoom.js +1 -1
- package/dist/components/app-logo/AppLogo.js +1 -1
- package/dist/components/avatar/Avatar.js +1 -1
- package/dist/components/bar-chart/BarChart.js +1 -1
- package/dist/components/bottom-navigation/BottomNavigation.d.ts +10 -0
- package/dist/components/bottom-navigation/BottomNavigation.js +1 -1
- package/dist/components/button/Button.js +1 -1
- package/dist/components/calendar/Calendar.js +1 -1
- package/dist/components/carousel/Carousel.d.ts +13 -0
- package/dist/components/carousel/Carousel.js +1 -1
- package/dist/components/checkbox/Checkbox.js +1 -1
- package/dist/components/code-block/CodeBlock.js +1 -1
- package/dist/components/color-picker/ColorPicker.js +1 -1
- package/dist/components/combobox/Combobox.d.ts +18 -0
- package/dist/components/combobox/Combobox.js +1 -1
- package/dist/components/command-palette/CommandPalette.js +1 -1
- package/dist/components/container/Container.d.ts +12 -4
- package/dist/components/container/Container.js +1 -1
- package/dist/components/data-table/DataTable.js +1 -1
- 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.js +1 -1
- package/dist/components/drawer/Drawer.js +1 -1
- package/dist/components/flex/Flex.d.ts +93 -0
- package/dist/components/flex/Flex.js +1 -0
- package/dist/components/flex/index.d.ts +2 -0
- package/dist/components/flex/index.js +1 -0
- package/dist/components/floating-action-button/FloatingActionButton.js +1 -1
- package/dist/components/footer/Footer.d.ts +4 -3
- package/dist/components/footer/Footer.js +1 -1
- package/dist/components/gallery/Gallery.d.ts +150 -0
- package/dist/components/gallery/Gallery.js +1 -0
- package/dist/components/gallery/GalleryViewer.d.ts +30 -0
- package/dist/components/gallery/GalleryViewer.js +1 -0
- package/dist/components/gallery/index.d.ts +2 -0
- package/dist/components/gallery/index.js +1 -0
- package/dist/components/gauge-chart/GaugeChart.js +1 -1
- package/dist/components/grid/Grid.d.ts +11 -1
- package/dist/components/grid/Grid.js +1 -1
- package/dist/components/grid-container/GridContainer.js +1 -1
- package/dist/components/header/Header.d.ts +5 -4
- package/dist/components/header/Header.js +1 -1
- package/dist/components/heatmap-chart/HeatmapChart.js +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 +155 -7
- package/dist/components/image/Image.js +1 -1
- package/dist/components/image/index.d.ts +1 -1
- package/dist/components/menu/Menu.js +1 -1
- package/dist/components/meter/Meter.d.ts +7 -0
- package/dist/components/meter/Meter.js +1 -1
- package/dist/components/navigation-menu/NavigationMenu.js +1 -1
- package/dist/components/number-field/NumberField.js +1 -1
- package/dist/components/otp-field/OtpField.js +1 -1
- package/dist/components/overlay/Overlay.js +1 -1
- package/dist/components/panes/Panes.js +1 -1
- package/dist/components/pie-chart/PieChart.js +1 -1
- package/dist/components/popover/Popover.js +1 -1
- package/dist/components/progress-circular/ProgressCircular.d.ts +10 -1
- package/dist/components/progress-circular/ProgressCircular.js +1 -1
- package/dist/components/progress-linear/ProgressLinear.d.ts +7 -1
- package/dist/components/progress-linear/ProgressLinear.js +1 -1
- package/dist/components/provider/NebaProvider.js +1 -1
- package/dist/components/radio-group/RadioGroup.js +1 -1
- package/dist/components/rating/Rating.js +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.d.ts +17 -11
- package/dist/components/scroll-zone/ScrollZone.js +1 -1
- package/dist/components/select/Select.d.ts +13 -0
- package/dist/components/select/Select.js +1 -1
- package/dist/components/show/Show.d.ts +60 -0
- package/dist/components/show/Show.js +1 -0
- package/dist/components/show/index.d.ts +2 -0
- package/dist/components/show/index.js +1 -0
- package/dist/components/sidebar/Sidebar.js +1 -1
- package/dist/components/slider/Slider.d.ts +37 -2
- package/dist/components/slider/Slider.js +1 -1
- package/dist/components/spoiler/Spoiler.js +1 -1
- package/dist/components/stack/Stack.d.ts +126 -0
- package/dist/components/stack/Stack.js +1 -0
- package/dist/components/stack/index.d.ts +1 -0
- package/dist/components/stack/index.js +1 -0
- package/dist/components/statistic/Statistic.d.ts +8 -3
- package/dist/components/tabs/Tabs.d.ts +46 -0
- package/dist/components/tabs/Tabs.js +1 -1
- package/dist/components/text-field/TextField.js +1 -1
- package/dist/components/time-picker/TimePicker.js +1 -1
- package/dist/components/timeline-chart/TimelineChart.js +1 -1
- package/dist/components/toast/Toast.js +1 -1
- package/dist/components/toggle/Toggle.js +1 -1
- package/dist/components/tooltip/Tooltip.js +1 -1
- package/dist/components/tour/Tour.js +1 -1
- package/dist/components/transfer/Transfer.js +1 -1
- package/dist/components/tree-select/TreeSelect.d.ts +2 -0
- package/dist/components/tree-select/TreeSelect.js +1 -1
- package/dist/components/tree-view/TreeView.js +1 -1
- package/dist/components/typography/Typography.js +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/useMediaQuery.d.ts +35 -1
- package/dist/hooks/useMediaQuery.js +1 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.js +1 -1
- package/dist/internal/animate.d.ts +65 -2
- package/dist/internal/animate.js +1 -1
- package/dist/internal/cache.d.ts +24 -0
- package/dist/internal/cache.js +1 -0
- package/dist/internal/calendar.d.ts +15 -42
- package/dist/internal/calendar.js +1 -1
- package/dist/internal/chart-frame.d.ts +48 -3
- package/dist/internal/chart-frame.js +1 -1
- package/dist/internal/chart-line.js +1 -1
- package/dist/internal/chart.d.ts +16 -0
- package/dist/internal/chart.js +1 -1
- package/dist/internal/date.js +1 -1
- package/dist/internal/drag.d.ts +8 -6
- package/dist/internal/drag.js +1 -1
- package/dist/internal/format.d.ts +21 -7
- package/dist/internal/format.js +1 -1
- package/dist/internal/grid.d.ts +29 -27
- package/dist/internal/grid.js +1 -1
- package/dist/internal/i18n.d.ts +92 -0
- package/dist/internal/i18n.js +1 -1
- package/dist/internal/icons.d.ts +25 -0
- package/dist/internal/icons.js +1 -1
- package/dist/internal/link.d.ts +5 -4
- package/dist/internal/media.d.ts +9 -2
- package/dist/internal/media.js +1 -1
- package/dist/internal/observe.js +1 -1
- package/dist/internal/page-layout.d.ts +11 -9
- package/dist/internal/page-layout.js +1 -1
- package/dist/internal/picker.d.ts +8 -3
- package/dist/internal/picker.js +1 -1
- package/dist/internal/progress.d.ts +24 -1
- package/dist/internal/progress.js +1 -1
- package/dist/internal/responsive.d.ts +97 -0
- package/dist/internal/responsive.js +1 -0
- package/dist/internal/styles.d.ts +140 -2
- package/dist/internal/styles.js +1 -1
- package/dist/internal/text.d.ts +32 -0
- package/dist/internal/text.js +1 -0
- package/dist/internal/wheel.d.ts +38 -0
- package/dist/internal/wheel.js +1 -0
- 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/tailwind.css +411 -30
- package/dist/types.d.ts +119 -6
- package/package.json +19 -18
- package/dist/components/avatar-group/AvatarGroup.d.ts +0 -47
- package/dist/components/avatar-group/AvatarGroup.js +0 -1
- package/dist/components/avatar-group/index.d.ts +0 -2
- package/dist/components/avatar-group/index.js +0 -1
- package/dist/internal/avatar-group.d.ts +0 -22
- package/dist/internal/avatar-group.js +0 -1
package/dist/internal/drag.d.ts
CHANGED
|
@@ -3,17 +3,19 @@
|
|
|
3
3
|
* that gives all of it back.
|
|
4
4
|
*
|
|
5
5
|
* Five components drag something: a Sidebar's edge, a Panes boundary, a
|
|
6
|
-
* WindowPane by its bar or its corner, a ScrollZone's strip, a DataTable's
|
|
7
|
-
* column rule
|
|
8
|
-
* is. What was written
|
|
9
|
-
* around it — three listeners, a
|
|
10
|
-
* selection, and a teardown an unmount
|
|
6
|
+
* WindowPane by its bar or its corner, a ScrollZone's strip, and a DataTable's
|
|
7
|
+
* column rule, its column headers and a run of its rows. The arithmetic differs
|
|
8
|
+
* in every one of them and stays where it is. What was written six times and
|
|
9
|
+
* had already drifted is the scaffold around it — three listeners, a
|
|
10
|
+
* `dataset.dragging`, the document's text selection, and a teardown an unmount
|
|
11
|
+
* can call.
|
|
11
12
|
*
|
|
12
13
|
* The drift is the reason this exists rather than the repetition. A DataTable's
|
|
13
14
|
* column resize was the one copy with no selection suppression in it, so
|
|
14
15
|
* dragging a column boundary in Safari selected the text of every cell the
|
|
15
16
|
* pointer crossed; and it was the one with no unmount teardown, so a table that
|
|
16
|
-
* went away mid-drag left two listeners on a detached node.
|
|
17
|
+
* went away mid-drag left two listeners on a detached node. Its row-range drag
|
|
18
|
+
* was the last copy and had the same hole in it, over more cells.
|
|
17
19
|
*
|
|
18
20
|
* There is deliberately **no requestAnimationFrame in here.** A `pointermove`
|
|
19
21
|
* is already delivered once per frame in every browser the library supports —
|
package/dist/internal/drag.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export function beginPointerDrag({target:e,pointerId:t,onMove:r,onEnd:n,selectable:o=!0,mark:s=!0}){const i=o?function(){const e=document.body,t=e.style.getPropertyValue("-webkit-user-select");return e.style.setProperty("-webkit-user-select","none"),()=>{t?e.style.setProperty("-webkit-user-select",t):e.style.removeProperty("-webkit-user-select")}}():null;s&&(e.dataset.dragging="true")
|
|
1
|
+
export function beginPointerDrag({target:e,pointerId:t,onMove:r,onEnd:n,selectable:o=!0,mark:s=!0}){const i=o?function(){const e=document.body,t=e.style.getPropertyValue("-webkit-user-select");return e.style.setProperty("-webkit-user-select","none"),()=>{t?e.style.setProperty("-webkit-user-select",t):e.style.removeProperty("-webkit-user-select")}}():null;s&&(e.dataset.dragging="true");try{e.setPointerCapture?.(t)}catch{}let a=!0;const c=()=>{a&&(a=!1,e.removeEventListener("pointermove",r),e.removeEventListener("pointerup",l),e.removeEventListener("pointercancel",l),s&&delete e.dataset.dragging,i?.())},l=()=>{c(),n?.()};return e.addEventListener("pointermove",r),e.addEventListener("pointerup",l),e.addEventListener("pointercancel",l),c}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The `Intl`
|
|
2
|
+
* The `Intl` objects, memoised.
|
|
3
3
|
*
|
|
4
|
-
* Here for the reason everything else in this folder is:
|
|
5
|
-
*
|
|
4
|
+
* Here for the reason everything else in this folder is: unrelated parts of the
|
|
5
|
+
* library construct them, and constructing one is the expensive half of
|
|
6
6
|
* using one. Measured on V8, `new Intl.NumberFormat(...).format(n)` costs about
|
|
7
7
|
* 16µs and `format(n)` on a formatter that already exists costs about 0.3µs —
|
|
8
8
|
* fifty-five times the work to produce the same string.
|
|
@@ -13,10 +13,11 @@
|
|
|
13
13
|
* one per category and one per tooltip row, and it writes all of them again on
|
|
14
14
|
* every re-render — which, on a chart being hovered, is every frame.
|
|
15
15
|
*
|
|
16
|
-
* The cache is keyed on the locale and the options together, and it
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
16
|
+
* The cache is keyed on the locale and the options together, and it goes
|
|
17
|
+
* through `memoise` so it cannot grow without bound. Nothing here grows with
|
|
18
|
+
* the size of a table or the length of a series — a page has a handful of
|
|
19
|
+
* option objects — but both halves of the key reach these functions from public
|
|
20
|
+
* props, so neither half is the library's to promise anything about.
|
|
20
21
|
*
|
|
21
22
|
* The options object is deliberately *not* part of the key by identity. A caller
|
|
22
23
|
* writing `format={{ style: 'currency', currency: 'USD' }}` inline hands over a
|
|
@@ -25,5 +26,18 @@
|
|
|
25
26
|
*/
|
|
26
27
|
/** A memoised `Intl.DateTimeFormat`. */
|
|
27
28
|
export declare function dateFormatter(locale: string | undefined, options: Intl.DateTimeFormatOptions): Intl.DateTimeFormat;
|
|
29
|
+
/**
|
|
30
|
+
* A memoised `Intl.Segmenter`, or `null` on a runtime that has none.
|
|
31
|
+
*
|
|
32
|
+
* The same rule as the two above, and the one constructor that was still being
|
|
33
|
+
* built per call. `AnimateTyping` asks for a string's graphemes, `AnimateSplit`
|
|
34
|
+
* for its words and `AnimateScramble` for its graphemes again — three effects
|
|
35
|
+
* that a page may well hold several of, each rebuilding a segmenter for a
|
|
36
|
+
* string that has not changed.
|
|
37
|
+
*
|
|
38
|
+
* `null` rather than a throw where `Intl.Segmenter` is missing: a caller can
|
|
39
|
+
* fall back to a spread, and a text effect is not worth taking a page down for.
|
|
40
|
+
*/
|
|
41
|
+
export declare function segmenter(locale: string | undefined, granularity: Intl.SegmenterOptions['granularity']): Intl.Segmenter | null;
|
|
28
42
|
/** A memoised `Intl.NumberFormat`. */
|
|
29
43
|
export declare function numberFormatter(locale: string | undefined, options?: Intl.NumberFormatOptions): Intl.NumberFormat;
|
package/dist/internal/format.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function t(t
|
|
1
|
+
import{memoise as n}from"./cache.js";function t(n,t){return`${n??""}\0${t?JSON.stringify(t):""}`}const e=new Map;export function dateFormatter(r,o){return n(e,t(r,o),()=>new Intl.DateTimeFormat(r,o))}const r=new Map;export function segmenter(e,o){return"undefined"!=typeof Intl&&"Segmenter"in Intl?n(r,t(e,{granularity:o}),()=>new Intl.Segmenter(e,{granularity:o})):null}const o=new Map;export function numberFormatter(e,r){return n(o,t(e,r),()=>new Intl.NumberFormat(e,r))}
|
package/dist/internal/grid.d.ts
CHANGED
|
@@ -1,43 +1,29 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The arithmetic and the vocabulary the
|
|
2
|
+
* The arithmetic and the vocabulary the layout components share.
|
|
3
3
|
*
|
|
4
4
|
* Like `internal/styles.ts` this is the library talking to itself, and it lives
|
|
5
5
|
* here rather than in either component's folder for the same reason
|
|
6
6
|
* `internal/button-group.ts` does: `GridContainer` and `Grid` are one system in
|
|
7
|
-
* two elements, and neither should have to import the other.
|
|
7
|
+
* two elements, and neither should have to import the other. `Flex` reads the
|
|
8
|
+
* alignment tables and the gutter arithmetic below and nothing else, which is
|
|
9
|
+
* the whole of what it has in common with a grid.
|
|
8
10
|
*
|
|
9
11
|
* What is *not* here is the layout itself. A column width is
|
|
10
12
|
* `(100% + gap) * span / columns - gap`, it has to change at four breakpoints,
|
|
11
13
|
* and it is the width of an element whose column count is declared on its
|
|
12
14
|
* parent — none of which Tailwind can spell, because Tailwind only ever sees
|
|
13
15
|
* class names written out literally and `columns` is a number a caller picks.
|
|
14
|
-
* So the widths are real CSS in `styles.css`, driven by the `--n-*` slots
|
|
15
|
-
*
|
|
16
|
-
* instance values go in inline custom properties, never in
|
|
17
|
-
|
|
18
|
-
import type * as React from 'react';
|
|
19
|
-
import type { NebaAlignItems, NebaAlignSelf, NebaBreakpoint, NebaJustifyContent, NebaResponsive } from '../types.js';
|
|
20
|
-
/** Smallest first, which is also the order the media queries have to be in. */
|
|
21
|
-
export declare const breakpoints: readonly NebaBreakpoint[];
|
|
22
|
-
/**
|
|
23
|
-
* Turns a responsive value into the `--n-{name}-{breakpoint}` slots the CSS
|
|
24
|
-
* reads, emitting only the breakpoints the caller actually named.
|
|
25
|
-
*
|
|
26
|
-
* The gaps are filled in by CSS rather than here: each breakpoint's rule falls
|
|
27
|
-
* back through the ones below it, so `{ md: 6 }` needs one slot and not five.
|
|
28
|
-
* That keeps the inline style on a grid item down to what was asked for.
|
|
29
|
-
*/
|
|
30
|
-
export declare function responsiveSlots<T>(name: string, value: NebaResponsive<T> | undefined, toCss: (value: T) => string): React.CSSProperties;
|
|
31
|
-
/**
|
|
32
|
-
* Fills in the `xs` entry of a partial map with the prop's own default.
|
|
16
|
+
* So the widths are real CSS in `styles.css`, driven by the `--n-*` slots
|
|
17
|
+
* `internal/responsive.ts` generates. That is the same split the rest of the
|
|
18
|
+
* library makes: per-instance values go in inline custom properties, never in
|
|
19
|
+
* class names.
|
|
33
20
|
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* below".
|
|
21
|
+
* What is also not here any more is that generator. `responsiveSlots` and
|
|
22
|
+
* `withBaseline` were written for the grid and are not about grids, so they sit
|
|
23
|
+
* in `responsive.ts` where a Container and a Flex can reach them without
|
|
24
|
+
* importing column arithmetic they will never run.
|
|
39
25
|
*/
|
|
40
|
-
|
|
26
|
+
import type { NebaAlignItems, NebaAlignSelf, NebaJustifyContent } from '../types.js';
|
|
41
27
|
/**
|
|
42
28
|
* A count of columns, as a plain number for `calc()` to divide by.
|
|
43
29
|
*
|
|
@@ -50,6 +36,22 @@ export declare function columnCount(value: number): string;
|
|
|
50
36
|
export declare function columnUnits(value: number, min: number): string;
|
|
51
37
|
export declare const spanValue: (value: number) => string;
|
|
52
38
|
export declare const offsetValue: (value: number) => string;
|
|
39
|
+
/**
|
|
40
|
+
* A width a column count cannot reach.
|
|
41
|
+
*
|
|
42
|
+
* `auto` is the contents' own width — an icon, a chip, a button at the end of
|
|
43
|
+
* a row — and `grow` is that plus whatever is left over in the row, which is
|
|
44
|
+
* how a title sits between an icon and an action. Neither is a share of
|
|
45
|
+
* twelve, so neither can come out of the arithmetic above.
|
|
46
|
+
*
|
|
47
|
+
* A number points back at `--n-col-width`, the arithmetic named in
|
|
48
|
+
* `styles.css`, rather than restating it: that is what lets one map mix the
|
|
49
|
+
* two — `span={{ xs: 'grow', md: 4 }}` — without the keyword at a narrow
|
|
50
|
+
* width leaking into a wider one.
|
|
51
|
+
*/
|
|
52
|
+
export declare function spanWidth(value: number | 'auto' | 'grow'): string;
|
|
53
|
+
/** Which of the two keywords takes the space the row has left. */
|
|
54
|
+
export declare function spanGrow(value: number | 'auto' | 'grow'): string;
|
|
53
55
|
/**
|
|
54
56
|
* A gutter, as a length.
|
|
55
57
|
*
|
package/dist/internal/grid.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export function columnCount(t){return String(Math.max(1,Math.round(t)))}export function columnUnits(t,e){return String(Math.max(e,Math.round(t)))}export const spanValue=t=>columnUnits(t,1);export const offsetValue=t=>columnUnits(t,0);export function spanWidth(t){return"number"==typeof t?"var(--n-col-width)":"auto"}export function spanGrow(t){return"grow"===t?"1":"0"}export function spacingValue(t){const e=.25*Math.max(0,t);return`${Number(e.toFixed(5))}rem`}export const justifyContentClasses={start:"justify-start",center:"justify-center",end:"justify-end","space-between":"justify-between","space-around":"justify-around","space-evenly":"justify-evenly",stretch:"justify-stretch"};export const alignItemsClasses={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch",baseline:"items-baseline"};export const alignContentClasses={start:"content-start",center:"content-center",end:"content-end","space-between":"content-between","space-around":"content-around","space-evenly":"content-evenly",stretch:"content-stretch"};export const alignSelfClasses={auto:"self-auto",start:"self-start",center:"self-center",end:"self-end",stretch:"self-stretch",baseline:"self-baseline"};
|
package/dist/internal/i18n.d.ts
CHANGED
|
@@ -285,9 +285,95 @@ export interface CarouselMessages {
|
|
|
285
285
|
slide: string;
|
|
286
286
|
previous: string;
|
|
287
287
|
next: string;
|
|
288
|
+
/**
|
|
289
|
+
* The button that stops the slides advancing on their own, and the same
|
|
290
|
+
* button once they have been stopped.
|
|
291
|
+
*
|
|
292
|
+
* It says what it will do rather than what the carousel is doing, which is
|
|
293
|
+
* what a button's name is for — and it names the object, because a lone
|
|
294
|
+
* "Pause" tells a screen reader's element list nothing about which of the
|
|
295
|
+
* things on the page it would pause.
|
|
296
|
+
*/
|
|
297
|
+
pause: string;
|
|
298
|
+
play: string;
|
|
288
299
|
}
|
|
289
300
|
/** The `carousel` namespace, as Carousel read it. */
|
|
290
301
|
export declare const carouselMessages: MessageTable<CarouselMessages>;
|
|
302
|
+
/**
|
|
303
|
+
* Every string a picker says that is not a date.
|
|
304
|
+
*
|
|
305
|
+
* One object rather than twenty props. These are a set: a caller who has to
|
|
306
|
+
* translate "Previous month" has to translate "Next month" in the same breath,
|
|
307
|
+
* and a component with twenty `*Label` props is a component whose signature is
|
|
308
|
+
* mostly apology. The same argument is why they are in here rather than
|
|
309
|
+
* defaulted in the pickers: a product in Korean should get all twenty from its
|
|
310
|
+
* `locale`, and the `labels` prop is then for the wording rather than for the
|
|
311
|
+
* language.
|
|
312
|
+
*
|
|
313
|
+
* The dates themselves are never in here — those come from `Intl`, which
|
|
314
|
+
* already knows what July is called in more languages than this file ever will.
|
|
315
|
+
*/
|
|
316
|
+
export interface PickerMessages {
|
|
317
|
+
/** The calendar's steppers, in day view. */
|
|
318
|
+
previousMonth: string;
|
|
319
|
+
nextMonth: string;
|
|
320
|
+
/** The same steppers in month view, where they move by a year. */
|
|
321
|
+
previousYear: string;
|
|
322
|
+
nextYear: string;
|
|
323
|
+
/** And in year view, where they move by a page of twelve. */
|
|
324
|
+
previousYears: string;
|
|
325
|
+
nextYears: string;
|
|
326
|
+
/** The two header buttons that open the month grid and the year grid. */
|
|
327
|
+
chooseMonth: string;
|
|
328
|
+
chooseYear: string;
|
|
329
|
+
/**
|
|
330
|
+
* The footer's actions. Three shortcuts rather than one because the button
|
|
331
|
+
* jumps to the current *unit*, and a month picker whose footer says "Today"
|
|
332
|
+
* is offering a day it has no way to accept.
|
|
333
|
+
*/
|
|
334
|
+
today: string;
|
|
335
|
+
thisMonth: string;
|
|
336
|
+
thisYear: string;
|
|
337
|
+
now: string;
|
|
338
|
+
clear: string;
|
|
339
|
+
done: string;
|
|
340
|
+
/** The clock's columns. */
|
|
341
|
+
hour: string;
|
|
342
|
+
minute: string;
|
|
343
|
+
second: string;
|
|
344
|
+
meridiem: string;
|
|
345
|
+
/** Which end of a range the calendar is currently asking for. */
|
|
346
|
+
start: string;
|
|
347
|
+
end: string;
|
|
348
|
+
}
|
|
349
|
+
/** The `picker` namespace, as the four date and time pickers read it. */
|
|
350
|
+
export declare const pickerMessages: MessageTable<PickerMessages>;
|
|
351
|
+
/**
|
|
352
|
+
* The gallery, and the viewer a tile opens into.
|
|
353
|
+
*
|
|
354
|
+
* A Carousel's words are next to these and are deliberately not reused: a
|
|
355
|
+
* carousel moves between *slides* and this moves between pictures, and a
|
|
356
|
+
* screen reader saying "next slide" over a wall of photographs is describing
|
|
357
|
+
* something the reader is not looking at.
|
|
358
|
+
*/
|
|
359
|
+
export interface GalleryMessages {
|
|
360
|
+
/** Names the list, when the caller did not. */
|
|
361
|
+
label: string;
|
|
362
|
+
/** One tile's position. `{index}` and `{total}` are replaced with the numbers. */
|
|
363
|
+
item: string;
|
|
364
|
+
previous: string;
|
|
365
|
+
next: string;
|
|
366
|
+
}
|
|
367
|
+
/** The `gallery` namespace, as Gallery and its viewer read it. */
|
|
368
|
+
export declare const galleryMessages: MessageTable<GalleryMessages>;
|
|
369
|
+
export interface ImageMessages {
|
|
370
|
+
/**
|
|
371
|
+
* What stands where the picture was, when the file did not arrive and the
|
|
372
|
+
* caller gave no `alt` to say what it was.
|
|
373
|
+
*/
|
|
374
|
+
unavailable: string;
|
|
375
|
+
}
|
|
376
|
+
export declare const imageMessages: MessageTable<ImageMessages>;
|
|
291
377
|
/**
|
|
292
378
|
* The charts.
|
|
293
379
|
*
|
|
@@ -543,6 +629,12 @@ export interface NebaLocale {
|
|
|
543
629
|
pagination?: Partial<PaginationMessages>;
|
|
544
630
|
/** Carousel. */
|
|
545
631
|
carousel?: Partial<CarouselMessages>;
|
|
632
|
+
/** Picker. */
|
|
633
|
+
picker?: Partial<PickerMessages>;
|
|
634
|
+
/** Gallery. */
|
|
635
|
+
gallery?: Partial<GalleryMessages>;
|
|
636
|
+
/** Image. */
|
|
637
|
+
image?: Partial<ImageMessages>;
|
|
546
638
|
/** Chart. */
|
|
547
639
|
chart?: Partial<ChartMessages>;
|
|
548
640
|
/** Scroll. */
|
package/dist/internal/i18n.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";export function fill(e,s){return e.replace(/\{(\w+)\}/g,(e,o)=>s[o]??e)}export const actionMessages={"":{close:"Close",dismiss:"Dismiss",clear:"Clear",remove:"Remove"}};export const confirmMessages={"":{confirm:"Confirm",cancel:"Cancel"}};export const linkMessages={"":{newTab:"(opens in a new tab)"}};export const spoilerMessages={"":{reveal:"Reveal",hide:"Hide",notice:"This may contain spoilers"}};export const chatMessages={"":{sending:"Sending",sent:"Sent",delivered:"Delivered",read:"Read",failed:"Not sent",typing:"Typing…"}};export const emptyMessages={"":{title:"Nothing here"}};export const tableMessages={"":{search:"Search",selectAll:"Select all rows",selectRow:"Select row",rowsPerPage:"Rows per page",range:"{start}–{end} of {total}",selected:"{count} selected",empty:"No data",exportCsv:"Export CSV"}};export const colorMessages={"":{area:"Saturation and brightness",hue:"Hue",alpha:"Opacity",value:"Colour value",swatches:"Preset colours",clear:"Clear",empty:"Choose a colour"}};export const ratingMessages={"":{label:"Rating",value:"{value} out of {max}",empty:"No rating"}};export const numberMessages={"":{increase:"Increase",decrease:"Decrease"}};export const paginationMessages={"":{label:"Pagination",page:"Page {page}",status:"Page {page} of {total}",previous:"Previous page",next:"Next page",first:"First page",last:"Last page"}};export const carouselMessages={"":{label:"Carousel",slide:"Slide {index} of {total}",previous:"Previous slide",next:"Next slide"}};export const chartMessages={"":{label:"Chart"}};export const scrollMessages={"":{label:"Scrollable content",previous:"Scroll back",next:"Scroll forward"}};export const breadcrumbMessages={"":{label:"Breadcrumb",expand:"Show hidden steps"}};export const commandMessages={"":{label:"Command palette",search:"Type a command or search…",empty:"No commands found"}};export const transferMessages={"":{source:"Available",target:"Selected",toTarget:"Move to selected",toSource:"Move to available",search:"Search",selectAll:"Select all",empty:"Nothing here"}};export const anchorMessages={"":{label:"On this page"}};export const comboboxMessages={"":{empty:"No matches",remove:"Remove {label}"}};export const overlayMessages={"":{label:"Overlay"}};export const windowMessages={"":{minimize:"Minimize",maximize:"Maximize",restore:"Restore",resize:"Resize window"}};export const layoutMessages={"":{skipToContent:"Skip to content",sidebar:"Sidebar",openSidebar:"Open sidebar",closeSidebar:"Close sidebar",resizeSidebar:"Resize sidebar"}};export const codeMessages={"":{code:"Code",copy:"Copy",copied:"Copied",copyFailed:"Could not copy",raw:"Raw",prompt:"Prompt"}};export const stepsMessages={"":{previous:"Previous",next:"Next",done:"Done",skip:"Skip",restart:"Start over",completed:"All steps complete",steps:"Steps",position:"{index} of {total}",step:"Step {index}: {title}"}};const
|
|
1
|
+
import*as e from"react";import{memoise as s}from"./cache.js";export function fill(e,s){return e.replace(/\{(\w+)\}/g,(e,o)=>s[o]??e)}export const actionMessages={"":{close:"Close",dismiss:"Dismiss",clear:"Clear",remove:"Remove"}};export const confirmMessages={"":{confirm:"Confirm",cancel:"Cancel"}};export const linkMessages={"":{newTab:"(opens in a new tab)"}};export const spoilerMessages={"":{reveal:"Reveal",hide:"Hide",notice:"This may contain spoilers"}};export const chatMessages={"":{sending:"Sending",sent:"Sent",delivered:"Delivered",read:"Read",failed:"Not sent",typing:"Typing…"}};export const emptyMessages={"":{title:"Nothing here"}};export const tableMessages={"":{search:"Search",selectAll:"Select all rows",selectRow:"Select row",rowsPerPage:"Rows per page",range:"{start}–{end} of {total}",selected:"{count} selected",empty:"No data",exportCsv:"Export CSV"}};export const colorMessages={"":{area:"Saturation and brightness",hue:"Hue",alpha:"Opacity",value:"Colour value",swatches:"Preset colours",clear:"Clear",empty:"Choose a colour"}};export const ratingMessages={"":{label:"Rating",value:"{value} out of {max}",empty:"No rating"}};export const numberMessages={"":{increase:"Increase",decrease:"Decrease"}};export const paginationMessages={"":{label:"Pagination",page:"Page {page}",status:"Page {page} of {total}",previous:"Previous page",next:"Next page",first:"First page",last:"Last page"}};export const carouselMessages={"":{label:"Carousel",slide:"Slide {index} of {total}",previous:"Previous slide",next:"Next slide",pause:"Pause slide show",play:"Play slide show"}};export const pickerMessages={"":{previousMonth:"Previous month",nextMonth:"Next month",previousYear:"Previous year",nextYear:"Next year",previousYears:"Previous years",nextYears:"Next years",chooseMonth:"Choose a month",chooseYear:"Choose a year",today:"Today",thisMonth:"This month",thisYear:"This year",now:"Now",clear:"Clear",done:"Done",hour:"Hour",minute:"Minute",second:"Second",meridiem:"AM/PM",start:"Start",end:"End"}};export const galleryMessages={"":{label:"Gallery",item:"Image {index} of {total}",previous:"Previous image",next:"Next image"}};export const imageMessages={"":{unavailable:"Image unavailable"}};export const chartMessages={"":{label:"Chart"}};export const scrollMessages={"":{label:"Scrollable content",previous:"Scroll back",next:"Scroll forward"}};export const breadcrumbMessages={"":{label:"Breadcrumb",expand:"Show hidden steps"}};export const commandMessages={"":{label:"Command palette",search:"Type a command or search…",empty:"No commands found"}};export const transferMessages={"":{source:"Available",target:"Selected",toTarget:"Move to selected",toSource:"Move to available",search:"Search",selectAll:"Select all",empty:"Nothing here"}};export const anchorMessages={"":{label:"On this page"}};export const comboboxMessages={"":{empty:"No matches",remove:"Remove {label}"}};export const overlayMessages={"":{label:"Overlay"}};export const windowMessages={"":{minimize:"Minimize",maximize:"Maximize",restore:"Restore",resize:"Resize window"}};export const layoutMessages={"":{skipToContent:"Skip to content",sidebar:"Sidebar",openSidebar:"Open sidebar",closeSidebar:"Close sidebar",resizeSidebar:"Resize sidebar"}};export const codeMessages={"":{code:"Code",copy:"Copy",copied:"Copied",copyFailed:"Could not copy",raw:"Raw",prompt:"Prompt"}};export const stepsMessages={"":{previous:"Previous",next:"Next",done:"Done",skip:"Skip",restart:"Start over",completed:"All steps complete",steps:"Steps",position:"{index} of {total}",step:"Step {index}: {title}"}};const o={zh:"zh-hans","zh-cn":"zh-hans","zh-my":"zh-hans","zh-sg":"zh-hans","zh-hk":"zh-hant","zh-mo":"zh-hant","zh-tw":"zh-hant"};const a=new WeakMap;export function resolveMessages(e,t){const r=e[""],n=t?.trim()??"";if(!n)return r;let i=a.get(e);return i||(i=new Map,a.set(e,i)),s(i,n,()=>{const s=function(e){const s=e.toLowerCase().split(/[-_]/).filter(Boolean),o=s[0];if(!o)return[];const a=s.slice(1),t=a.find(e=>/^[a-z]{4}$/.test(e)),r=a.find(e=>/^([a-z]{2}|\d{3})$/.test(e));return[t?`${o}-${t}`:"",r?`${o}-${r}`:"",o].filter(Boolean)}(n).map(s=>{const a=Object.hasOwn(o,s)?o[s]:void 0;return Object.hasOwn(e,s)?e[s]:a&&Object.hasOwn(e,a)?e[a]:void 0}).find(Boolean);return s?{...r,...s}:r})}export function useMessages(s,o){return e.useMemo(()=>resolveMessages(s,o),[s,o])}export function fillMessage(e,s){return e.replace(/\{(\w+)\}/g,(e,o)=>Object.hasOwn(s,o)?s[o]:e)}const t={action:actionMessages,confirm:confirmMessages,link:linkMessages,spoiler:spoilerMessages,chat:chatMessages,empty:emptyMessages,table:tableMessages,color:colorMessages,rating:ratingMessages,number:numberMessages,pagination:paginationMessages,carousel:carouselMessages,picker:pickerMessages,gallery:galleryMessages,image:imageMessages,chart:chartMessages,scroll:scrollMessages,breadcrumb:breadcrumbMessages,anchor:anchorMessages,transfer:transferMessages,command:commandMessages,combobox:comboboxMessages,overlay:overlayMessages,window:windowMessages,layout:layoutMessages,code:codeMessages,steps:stepsMessages};export function registerMessages(e,s){const o=e.trim().toLowerCase();for(const[e,r]of Object.entries(s)){const s=t[e];s&&r&&(s[o]=r,a.delete(s))}}
|
package/dist/internal/icons.d.ts
CHANGED
|
@@ -101,6 +101,17 @@ export declare function CodeIcon(): React.JSX.Element;
|
|
|
101
101
|
* it on the button under a finished guide.
|
|
102
102
|
*/
|
|
103
103
|
export declare function RestartIcon(): React.JSX.Element;
|
|
104
|
+
/**
|
|
105
|
+
* Stop and start, as the pair a rotation control switches between.
|
|
106
|
+
*
|
|
107
|
+
* Drawn as solids rather than as outlines, and at the same optical weight as
|
|
108
|
+
* each other: they sit in one button that swaps between them, so a pair that
|
|
109
|
+
* did not match in weight would read as the button changing size. The triangle
|
|
110
|
+
* is inset a little further than the bars because a shape that tapers to a
|
|
111
|
+
* point looks larger than a rectangle covering the same box.
|
|
112
|
+
*/
|
|
113
|
+
export declare function PauseIcon(): React.JSX.Element;
|
|
114
|
+
export declare function PlayIcon(): React.JSX.Element;
|
|
104
115
|
/**
|
|
105
116
|
* The three dots that stand for what has been left out.
|
|
106
117
|
*
|
|
@@ -112,6 +123,20 @@ export declare function RestartIcon(): React.JSX.Element;
|
|
|
112
123
|
export declare function EllipsisIcon(): React.JSX.Element;
|
|
113
124
|
export declare function StarIcon(): React.JSX.Element;
|
|
114
125
|
export declare function StarOutlineIcon(): React.JSX.Element;
|
|
126
|
+
/**
|
|
127
|
+
* The ring a control that is working draws in place of its own start icon.
|
|
128
|
+
*
|
|
129
|
+
* Two components draw it, and it is here rather than in either of them because
|
|
130
|
+
* a Button that is submitting and a TextField that is checking what was typed
|
|
131
|
+
* have to read as the same object in motion — the same ring at the same weight
|
|
132
|
+
* turning at the same rate. Two drawings would be two objects, and the second
|
|
133
|
+
* one would drift the first time either was touched.
|
|
134
|
+
*
|
|
135
|
+
* The arc is a quarter of the circle behind it, and both are stroked at 2 rather
|
|
136
|
+
* than the 1.5 every other glyph here uses: a ring that turns is read as a
|
|
137
|
+
* shape rather than as a line, and at 1.5 it reads as a smudge.
|
|
138
|
+
*/
|
|
139
|
+
export declare function SpinnerIcon(): React.JSX.Element;
|
|
115
140
|
/** The filled dot: the chosen one of a set, where a tick would say "and". */
|
|
116
141
|
export declare function DotIcon(): React.JSX.Element;
|
|
117
142
|
/** The neutral note: a circled `i` without the serif problem an `i` has at 16px. */
|
package/dist/internal/icons.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as r,jsxs as e}from"react/jsx-runtime";export function CloseIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"m4.5 4.5 7 7m0-7-7 7",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})}export function ChevronIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"m4.5 6.5 3.5 3.5 3.5-3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}export function CheckIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"m3.5 8.5 3 3 6-6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}export function MinusIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"M3.5 8h9",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})}export function PlusIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"M8 3.5v9M3.5 8h9",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})}export function TrendUpIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("path",{d:"M3 11 6.5 7.5 9 10l4-4",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"}),r("path",{d:"M9.5 6h3.5v3.5",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})]})}export function TrendDownIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("path",{d:"M3 5 6.5 8.5 9 6l4 4",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"}),r("path",{d:"M9.5 10h3.5V6.5",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})]})}export function CalendarIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("rect",{x:"2",y:"3.25",width:"12",height:"10.75",rx:"2",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"M2 6.75h12",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"M5.25 1.75v2.5M10.75 1.75v2.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}export function ClockIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("circle",{cx:"8",cy:"8",r:"6.25",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"M8 4.5V8l2.4 1.6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}export function ArrowRightIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"M3 8h10m-3.5-3.5L13 8l-3.5 3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}export function LinkIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("path",{d:"M6.5 9.5a2.75 2.75 0 0 0 4 .25l1.75-1.75a2.75 2.75 0 0 0-3.9-3.9L7.75 5.2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),r("path",{d:"M9.5 6.5a2.75 2.75 0 0 0-4-.25L3.75 8a2.75 2.75 0 0 0 3.9 3.9l.6-.6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}export function ExternalLinkIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("path",{d:"M12.75 9.25v2.5a1.5 1.5 0 0 1-1.5 1.5h-7a1.5 1.5 0 0 1-1.5-1.5v-7a1.5 1.5 0 0 1 1.5-1.5h2.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),r("path",{d:"M9.5 2.75h3.75V6.5M7.25 8.75l5.75-5.75",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}export function CopyIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("rect",{x:"5.75",y:"5.75",width:"7.5",height:"7.5",rx:"1.75",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"M10.25 3.6a1.85 1.85 0 0 0-1.5-.85h-4a2 2 0 0 0-2 2v4c0 .62.28 1.17.72 1.54",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}export function CodeIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"M5.75 4.5 2.5 8l3.25 3.5m4.5-7L13.5 8l-3.25 3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}export function RestartIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("path",{d:"M13 8a5 5 0 1 1-1.6-3.67",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),r("path",{d:"M13.25 2.25v3h-3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}export function EllipsisIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("circle",{cx:"3.5",cy:"8",r:"1.15",fill:"currentColor"}),r("circle",{cx:"8",cy:"8",r:"1.15",fill:"currentColor"}),r("circle",{cx:"12.5",cy:"8",r:"1.15",fill:"currentColor"})]})}const o="M8 1.4 9.71 5.65 14.28 5.96 10.76 8.9 11.88 13.34 8 10.9 4.12 13.34 5.24 8.9 1.72 5.96 6.29 5.65Z";export function StarIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:o,fill:"currentColor",stroke:"currentColor",strokeLinejoin:"round"})})}export function StarOutlineIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:o,stroke:"currentColor",strokeWidth:"1.25",strokeLinejoin:"round"})})}export function DotIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("circle",{cx:"8",cy:"8",r:"3.25",fill:"currentColor"})})}export function NoteIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("circle",{cx:"8",cy:"8",r:"6.25",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"M8 7.25v4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),r("circle",{cx:"8",cy:"4.9",r:"0.85",fill:"currentColor"})]})}export function SuccessIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("circle",{cx:"8",cy:"8",r:"6.25",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"m5.25 8.25 1.9 1.9 3.6-3.9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}export function WarningIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("path",{d:"M7.13 2.6 1.9 11.7a1 1 0 0 0 .87 1.5h10.46a1 1 0 0 0 .87-1.5L8.87 2.6a1 1 0 0 0-1.74 0Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),r("path",{d:"M8 6.1v3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),r("circle",{cx:"8",cy:"11.2",r:"0.85",fill:"currentColor"})]})}export function DangerIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("circle",{cx:"8",cy:"8",r:"6.25",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"m5.9 5.9 4.2 4.2m0-4.2-4.2 4.2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}export function severityIcon(e){switch(e){case"success":return r(SuccessIcon,{});case"warning":return r(WarningIcon,{});case"danger":return r(DangerIcon,{});default:return r(NoteIcon,{})}}
|
|
1
|
+
import{jsx as r,jsxs as e}from"react/jsx-runtime";export function CloseIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"m4.5 4.5 7 7m0-7-7 7",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})}export function ChevronIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"m4.5 6.5 3.5 3.5 3.5-3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}export function CheckIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"m3.5 8.5 3 3 6-6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}export function MinusIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"M3.5 8h9",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})}export function PlusIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"M8 3.5v9M3.5 8h9",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})}export function TrendUpIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("path",{d:"M3 11 6.5 7.5 9 10l4-4",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"}),r("path",{d:"M9.5 6h3.5v3.5",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})]})}export function TrendDownIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("path",{d:"M3 5 6.5 8.5 9 6l4 4",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"}),r("path",{d:"M9.5 10h3.5V6.5",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})]})}export function CalendarIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("rect",{x:"2",y:"3.25",width:"12",height:"10.75",rx:"2",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"M2 6.75h12",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"M5.25 1.75v2.5M10.75 1.75v2.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}export function ClockIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("circle",{cx:"8",cy:"8",r:"6.25",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"M8 4.5V8l2.4 1.6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}export function ArrowRightIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"M3 8h10m-3.5-3.5L13 8l-3.5 3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}export function LinkIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("path",{d:"M6.5 9.5a2.75 2.75 0 0 0 4 .25l1.75-1.75a2.75 2.75 0 0 0-3.9-3.9L7.75 5.2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),r("path",{d:"M9.5 6.5a2.75 2.75 0 0 0-4-.25L3.75 8a2.75 2.75 0 0 0 3.9 3.9l.6-.6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}export function ExternalLinkIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("path",{d:"M12.75 9.25v2.5a1.5 1.5 0 0 1-1.5 1.5h-7a1.5 1.5 0 0 1-1.5-1.5v-7a1.5 1.5 0 0 1 1.5-1.5h2.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),r("path",{d:"M9.5 2.75h3.75V6.5M7.25 8.75l5.75-5.75",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}export function CopyIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("rect",{x:"5.75",y:"5.75",width:"7.5",height:"7.5",rx:"1.75",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"M10.25 3.6a1.85 1.85 0 0 0-1.5-.85h-4a2 2 0 0 0-2 2v4c0 .62.28 1.17.72 1.54",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}export function CodeIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"M5.75 4.5 2.5 8l3.25 3.5m4.5-7L13.5 8l-3.25 3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}export function RestartIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("path",{d:"M13 8a5 5 0 1 1-1.6-3.67",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),r("path",{d:"M13.25 2.25v3h-3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}export function PauseIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:[r("rect",{x:"4",y:"3",width:"2.75",height:"10",rx:"1"}),r("rect",{x:"9.25",y:"3",width:"2.75",height:"10",rx:"1"})]})}export function PlayIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:r("path",{d:"M5.5 3.6a1 1 0 0 1 1.53-.85l6.1 3.9a1.2 1.2 0 0 1 0 2.02l-6.1 3.9a1 1 0 0 1-1.53-.85V3.6Z"})})}export function EllipsisIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("circle",{cx:"3.5",cy:"8",r:"1.15",fill:"currentColor"}),r("circle",{cx:"8",cy:"8",r:"1.15",fill:"currentColor"}),r("circle",{cx:"12.5",cy:"8",r:"1.15",fill:"currentColor"})]})}const o="M8 1.4 9.71 5.65 14.28 5.96 10.76 8.9 11.88 13.34 8 10.9 4.12 13.34 5.24 8.9 1.72 5.96 6.29 5.65Z";export function StarIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:o,fill:"currentColor",stroke:"currentColor",strokeLinejoin:"round"})})}export function StarOutlineIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:o,stroke:"currentColor",strokeWidth:"1.25",strokeLinejoin:"round"})})}export function SpinnerIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",className:"animate-spin",children:[r("circle",{cx:"8",cy:"8",r:"6.5",stroke:"currentColor",strokeOpacity:"0.25",strokeWidth:"2"}),r("path",{d:"M14.5 8A6.5 6.5 0 0 0 8 1.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}export function DotIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("circle",{cx:"8",cy:"8",r:"3.25",fill:"currentColor"})})}export function NoteIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("circle",{cx:"8",cy:"8",r:"6.25",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"M8 7.25v4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),r("circle",{cx:"8",cy:"4.9",r:"0.85",fill:"currentColor"})]})}export function SuccessIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("circle",{cx:"8",cy:"8",r:"6.25",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"m5.25 8.25 1.9 1.9 3.6-3.9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}export function WarningIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("path",{d:"M7.13 2.6 1.9 11.7a1 1 0 0 0 .87 1.5h10.46a1 1 0 0 0 .87-1.5L8.87 2.6a1 1 0 0 0-1.74 0Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),r("path",{d:"M8 6.1v3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),r("circle",{cx:"8",cy:"11.2",r:"0.85",fill:"currentColor"})]})}export function DangerIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("circle",{cx:"8",cy:"8",r:"6.25",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"m5.9 5.9 4.2 4.2m0-4.2-4.2 4.2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}export function severityIcon(e){switch(e){case"success":return r(SuccessIcon,{});case"warning":return r(WarningIcon,{});case"danger":return r(DangerIcon,{});default:return r(NoteIcon,{})}}
|
package/dist/internal/link.d.ts
CHANGED
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
* pointing back at this one, and a `Referer` header naming it. Modern browsers
|
|
6
6
|
* imply `noopener` for `target="_blank"`; none of them implies `noreferrer`,
|
|
7
7
|
* and neither is implied for a named target. So the two tokens are added
|
|
8
|
-
* wherever a component lets a caller choose where a link opens — TextLink,
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
8
|
+
* wherever a component lets a caller choose where a link opens — TextLink, a
|
|
9
|
+
* Menu row, a NavigationMenu link, a ChatBubble's link, an AppLogo, a
|
|
10
|
+
* BottomNavigation destination — and they are added the same way in all of
|
|
11
|
+
* them, because a library where only some are safe is a library whose users
|
|
12
|
+
* cannot tell which.
|
|
12
13
|
*
|
|
13
14
|
* It is a *merge* and not an override, and that is the whole reason this is a
|
|
14
15
|
* function rather than a string. The common reason to write a `rel` by hand is
|
package/dist/internal/media.d.ts
CHANGED
|
@@ -8,12 +8,19 @@ export declare function noMatchOnServer(): boolean;
|
|
|
8
8
|
/**
|
|
9
9
|
* The five widths, written once and read in both directions.
|
|
10
10
|
*
|
|
11
|
-
* They are Tailwind's
|
|
12
|
-
*
|
|
11
|
+
* They are Tailwind's defaults, which is what makes a Neba layout and a `md:`
|
|
12
|
+
* utility change at the same moment — and they are here rather than in
|
|
13
13
|
* `page-layout.ts`, where they used to be, because a layout asks "is the window
|
|
14
14
|
* *narrower* than this" and a caller asks "is it *at least* this". Two
|
|
15
15
|
* questions, one table: a second copy would be a second chance for the two to
|
|
16
16
|
* disagree about what `md` is.
|
|
17
|
+
*
|
|
18
|
+
* This copy is the fallback rather than the source. `styles.css` publishes the
|
|
19
|
+
* same four widths as `--neba-breakpoint-*`, filled in from Tailwind's own
|
|
20
|
+
* theme at build time, and `readBreakpoints` below prefers those — so a
|
|
21
|
+
* consumer who moves `--breakpoint-md` moves the CSS and this together instead
|
|
22
|
+
* of leaving the two to disagree silently. What is written here is what a
|
|
23
|
+
* server, and a page whose stylesheet has not arrived, has to answer with.
|
|
17
24
|
*/
|
|
18
25
|
export declare const breakpointWidths: Record<NebaBreakpoint, string>;
|
|
19
26
|
/** Narrower than this breakpoint. `xs` has nothing below it, so it is `null`. */
|
package/dist/internal/media.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import*as e from"react";const r=new Map;function
|
|
1
|
+
"use client";import*as e from"react";import{memoise as t}from"./cache.js";const r=new Map;function n(e){return t(r,e,()=>"undefined"!=typeof window&&window.matchMedia?window.matchMedia(e):null)}export function subscribeToQuery(e,t){const r=n(e);return r?(r.addEventListener("change",t),()=>r.removeEventListener("change",t)):()=>{}}export function queryMatches(e){return n(e)?.matches??!1}export function noMatchOnServer(){return!1}export const breakpointWidths={xs:"0rem",sm:"40rem",md:"48rem",lg:"64rem",xl:"80rem"};let o=null;function u(){if(o)return o;if("undefined"==typeof window||!window.getComputedStyle)return breakpointWidths;const e=getComputedStyle(document.documentElement),t={...breakpointWidths};for(const r of["sm","md","lg","xl"]){const n=e.getPropertyValue(`--neba-breakpoint-${r}`).trim();n&&(t[r]=n)}return o=t,t}export function widthBelow(e){return"xs"===e?null:`(width < ${u()[e]})`}export function widthAtLeast(e){return`(width >= ${u()[e]})`}export function useMediaQuery(t){const r=e.useCallback(e=>t?subscribeToQuery(t,e):()=>{},[t]),n=e.useCallback(()=>!!t&&queryMatches(t),[t]);return e.useSyncExternalStore(r,n,noMatchOnServer)}export const reducedMotionQuery="(prefers-reduced-motion: reduce)";const c=e=>subscribeToQuery(reducedMotionQuery,e),i=()=>queryMatches(reducedMotionQuery);export function usePrefersReducedMotion(){return e.useSyncExternalStore(c,i,noMatchOnServer)}
|
package/dist/internal/observe.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=new Map;let t=null;export function observeResize(r,n){const s="undefined"==typeof ResizeObserver?null:(t??=new ResizeObserver(t=>{for(const r of t){const t=e.get(r.target);if(t)for(const e of[...t])e(r)}}),t);if(!s)return()=>{};let o=e.get(r);return o||(o=new Set,e.set(r,o),s.observe(r)),o.add(n),()=>{const t=e.get(r);t&&(t.delete(n),0===t.size&&(e.delete(r),s.unobserve(r)))}}const r=new Map;export function observeVisibility(e,t,n){const s=function(e){if("undefined"==typeof IntersectionObserver)return null;let t=r.get(e);if(!t){const n=new Map;t={watchers:n,observer:new IntersectionObserver(e=>{for(const t of e){const e=n.get(t.target);if(e)for(const r of[...e])r(t.isIntersecting)}},{threshold:e})},r.set(e,t)}return t}(t);if(!s)return null;let o=s.watchers.get(e);return o||(o=new Set,s.watchers.set(e,o),s.observer.observe(e)),o.add(n),()=>{const
|
|
1
|
+
const e=new Map;let t=null;export function observeResize(r,n){const s="undefined"==typeof ResizeObserver?null:(t??=new ResizeObserver(t=>{for(const r of t){const t=e.get(r.target);if(t)for(const e of[...t])e(r)}}),t);if(!s)return()=>{};let o=e.get(r);return o||(o=new Set,e.set(r,o),s.observe(r)),o.add(n),()=>{const t=e.get(r);t&&(t.delete(n),0===t.size&&(e.delete(r),s.unobserve(r)))}}const r=new Map;export function observeVisibility(e,t,n){const s=function(e){if("undefined"==typeof IntersectionObserver)return null;let t=r.get(e);if(!t){const n=new Map;t={watchers:n,observer:new IntersectionObserver(e=>{for(const t of e){const e=n.get(t.target);if(e)for(const r of[...e])r(t.isIntersecting)}},{threshold:e})},r.set(e,t)}return t}(t);if(!s)return null;let o=s.watchers.get(e);return o||(o=new Set,s.watchers.set(e,o),s.observer.observe(e)),o.add(n),()=>{const o=s.watchers.get(e);o&&(o.delete(n),0===o.size&&(s.watchers.delete(e),s.observer.unobserve(e),0===s.watchers.size&&(s.observer.disconnect(),r.delete(t))))}}
|
|
@@ -107,16 +107,18 @@ export declare const SidebarSideContext: React.Context<SidebarSide | null>;
|
|
|
107
107
|
* The same five widths as Tailwind variants, for the parts of this that are
|
|
108
108
|
* decided in CSS rather than in JavaScript.
|
|
109
109
|
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
110
|
+
* The tables themselves are `internal/responsive.ts`', because `Show` asks the
|
|
111
|
+
* identical question and two spellings of "hidden below `md`" would be two
|
|
112
|
+
* chances to disagree. What is added here is only the sixth key: `none` is a
|
|
113
|
+
* layout that never collapses, which is not a breakpoint and has no place in a
|
|
114
|
+
* table the rest of the library reads.
|
|
113
115
|
*
|
|
114
|
-
* `
|
|
115
|
-
* sidebar's own trigger wants: the hamburger exists exactly while the
|
|
116
|
-
* does not. `
|
|
117
|
-
* wants for the one paint between the server's HTML arriving
|
|
118
|
-
* finding out how wide the window is — without it a phone draws
|
|
119
|
-
* full width and then throws it away.
|
|
116
|
+
* `collapsedOnlyClasses` hides something at and above the breakpoint, which is
|
|
117
|
+
* what a sidebar's own trigger wants: the hamburger exists exactly while the
|
|
118
|
+
* sidebar does not. `expandedOnlyClasses` hides it below, which is what the
|
|
119
|
+
* sidebar's column wants for the one paint between the server's HTML arriving
|
|
120
|
+
* and JavaScript finding out how wide the window is — without it a phone draws
|
|
121
|
+
* the sidebar full width and then throws it away.
|
|
120
122
|
*/
|
|
121
123
|
export declare const collapsedOnlyClasses: Record<PageLayoutCollapse, string>;
|
|
122
124
|
export declare const expandedOnlyClasses: Record<PageLayoutCollapse, string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import*as e from"react";import{useMediaQuery as t,widthBelow as n}from"./media.js";export const PageLayoutContext=/*@__PURE__*/e.createContext({present:!1,register:()=>{},collapseBelow:"none",open:{start:!1,end:!1},setOpen:()=>{},scroll:"page"});export const SidebarSideContext=/*@__PURE__*/e.createContext(null);export const collapsedOnlyClasses={none:"hidden"
|
|
1
|
+
"use client";import*as e from"react";import{useMediaQuery as t,widthBelow as n}from"./media.js";import{hiddenBelowClasses as o,hiddenFromClasses as r}from"./responsive.js";export const PageLayoutContext=/*@__PURE__*/e.createContext({present:!1,register:()=>{},collapseBelow:"none",open:{start:!1,end:!1},setOpen:()=>{},scroll:"page"});export const SidebarSideContext=/*@__PURE__*/e.createContext(null);export const collapsedOnlyClasses={none:"hidden",...r};export const expandedOnlyClasses={none:"",...o};export function useCollapsed(e){return t("none"===e?null:n(e))}export function drawerSide(e){const t="undefined"!=typeof document&&"rtl"===getComputedStyle(document.documentElement).direction;return"start"===e?t?"right":"left":t?"left":"right"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { PickerLabels } from './calendar.js';
|
|
3
2
|
import type { NebaColor, NebaElevation, NebaSize, NebaStyleProps } from '../types.js';
|
|
4
3
|
/**
|
|
5
4
|
* The shell all four pickers wear: a field-shaped trigger with a popup hanging
|
|
@@ -74,7 +73,13 @@ interface InternalShellProps extends PickerShellProps {
|
|
|
74
73
|
onClear: () => void;
|
|
75
74
|
open: boolean;
|
|
76
75
|
onOpenChange: (open: boolean) => void;
|
|
77
|
-
|
|
76
|
+
/**
|
|
77
|
+
* The × that empties the control, named. One string rather than the whole
|
|
78
|
+
* `labels` set, which is all the shell ever drew of it — asking for
|
|
79
|
+
* twenty to render one is what had a ColorPicker spreading the picker
|
|
80
|
+
* defaults it does not use over a label it does.
|
|
81
|
+
*/
|
|
82
|
+
clearLabel: string;
|
|
78
83
|
/** `<input type="hidden">` rows, so the control submits with a form. */
|
|
79
84
|
hiddenValues?: Array<{
|
|
80
85
|
name: string;
|
|
@@ -99,7 +104,7 @@ interface InternalShellProps extends PickerShellProps {
|
|
|
99
104
|
* and the way `invalid` re-points the whole colour family at `danger` so the
|
|
100
105
|
* edge, the ring and the message turn over together.
|
|
101
106
|
*/
|
|
102
|
-
export declare function PickerShell({ variant, size, color, density, elevation, label, description, error, invalid, startIcon, fullWidth, disabled, readOnly, required, id, className, style, display, samples, empty, clearable, onClear, open, onOpenChange,
|
|
107
|
+
export declare function PickerShell({ variant, size, color, density, elevation, label, description, error, invalid, startIcon, fullWidth, disabled, readOnly, required, id, className, style, display, samples, empty, clearable, onClear, open, onOpenChange, clearLabel, hiddenValues, sideOffset, popupClassName, children, triggerRef, ...props }: InternalShellProps): React.JSX.Element;
|
|
103
108
|
/**
|
|
104
109
|
* The row of shortcuts under a picker's panel.
|
|
105
110
|
*
|
package/dist/internal/picker.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as
|
|
1
|
+
import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as n from"react";import{Field as a}from"@base-ui/react/field";import{Popover as r}from"@base-ui/react/popover";import{CloseIcon as i}from"./icons.js";import{WidthSizer as t}from"./sizer.js";import{chipRemoveClasses as o,controlTextLeadingClasses as s,cx as d,disabledClasses as c,fieldFocusTransitionClasses as p,fieldHeightClasses as u,fieldReadOnlyClasses as m,fieldRestClasses as f,fieldRingClasses as b,gapClasses as h,iconClasses as x,metaTextClasses as g,paddingXClasses as v,popupFadeClasses as N,radiusClasses as y,stackGapClasses as P,surfaceClasses as w,surfaceSlots as j,transitionClasses as C}from"./styles.js";export function popupSlots(e,l){return{...j(e,l),"--n-fill":`var(--neba-${e}-fill)`,"--n-fill-hover":`var(--neba-${e}-fill-hover)`,"--n-fill-active":`var(--neba-${e}-fill-active)`,"--n-on-solid":`var(--neba-${e}-on-solid)`}}const k=["group relative flex w-full items-center select-none","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",C,p,b,x].join(" ");export const pickerPopupClasses=[w,"border bg-(--n-panel-press)","[border-color:var(--n-line)]","[box-shadow:var(--neba-shadow-3),var(--neba-plate-glass)]","[outline:none]",N].join(" ");export const popupPaddingClasses={xs:"p-1.5",sm:"p-2",md:"p-2.5",lg:"p-3",xl:"p-3.5"};export function PickerShell({variant:p="outline",size:b="md",color:x="primary",density:N="default",elevation:w=0,label:C,description:$,error:z,invalid:O,startIcon:F,fullWidth:R=!1,disabled:S=!1,readOnly:q=!1,required:D=!1,id:I,className:L,style:E,display:T,samples:V,empty:W,clearable:A=!1,onClear:B,open:G,onOpenChange:H,clearLabel:J,hiddenValues:K,sideOffset:M=6,popupClassName:Q,children:U,triggerRef:X,...Y}){const Z=n.useId(),_=I??`${Z}-trigger`,ee=`${Z}-label`,le=`${Z}-description`,ne=`${Z}-error`,ae=null!=z&&!1!==z&&""!==z,re=O??ae,ie=re?"danger":x,te=S||q,oe=d($?le:null,ae?ne:null)||void 0;return l(a.Root,{disabled:S,invalid:re,className:d("flex-col align-top",P[b],R?"flex w-full":"inline-flex",L),style:{...j(ie,w),...E},...Y,children:[C?e(a.Label,{id:ee,htmlFor:_,className:d(g[b],"font-medium",S?"text-(--neba-disabled-fg)":"text-(--neba-fg)"),children:C}):null,l(r.Root,{open:G,onOpenChange:e=>H(e),children:[l("span",{className:d(k,u[b],s[b],y[b],h[b],v[N][b],S?c[p]:q?m[p]:f[p]),children:[l(r.Trigger,{id:_,ref:X,disabled:S,"aria-labelledby":C?ee:void 0,"aria-describedby":oe,"aria-required":D||void 0,"aria-invalid":re||void 0,className:d("flex min-w-0 flex-1 items-center bg-transparent text-start [font:inherit] text-inherit",h[b],"[outline:none]",te?"cursor-default":"cursor-pointer"),children:[F?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--neba-muted-fg) transition-[color] duration-(--neba-duration) group-focus-within:text-(--n-accent)",children:F}):null,l("span",{className:"flex min-w-0 flex-1 flex-col",children:[e("span",{className:d("w-full truncate",W?"text-(--neba-muted-fg)":"text-(--neba-fg)"),children:T}),e(t,{samples:V??[]})]})]}),!A||W||te?null:e("button",{type:"button","aria-label":J,className:d(o,"text-(--neba-muted-fg)"),onClick:e=>{e.stopPropagation(),B()},children:e(i,{})})]}),e(r.Portal,{children:e(r.Positioner,{className:"neba-portal z-(--neba-z-portal) [outline:none]",sideOffset:M,align:"start",children:e(r.Popup,{initialFocus:!1,className:d(pickerPopupClasses,y[b],popupPaddingClasses[b],s[b],Q),style:popupSlots(ie,3),children:U})})})]}),$?e(a.Description,{id:le,className:d(g[b],"text-(--neba-muted-fg)"),children:$}):null,ae?e(a.Error,{id:ne,match:!0,className:d(g[b],"text-(--n-accent)"),children:z}):null,K?.map((l,n)=>e("input",{type:"hidden",name:l.name,value:l.value},n))]})}export function PickerFooter({size:l,children:n}){return e("div",{className:d("flex items-center justify-end border-t pt-1.5","[border-color:var(--n-line)]",h[l]),children:n})}export function PickerDivider(){return e("div",{"aria-hidden":"true",className:"w-px self-stretch bg-(--n-line)"})}
|
|
@@ -16,7 +16,20 @@
|
|
|
16
16
|
* first time a page carried both.
|
|
17
17
|
*/
|
|
18
18
|
import type * as React from 'react';
|
|
19
|
-
import type { NebaColor, NebaSize } from '../types.js';
|
|
19
|
+
import type { NebaColor, NebaSize, NebaThreshold } from '../types.js';
|
|
20
|
+
/**
|
|
21
|
+
* Which family a reading has earned.
|
|
22
|
+
*
|
|
23
|
+
* A `Meter` and a `GaugeChart` both answer this and had a copy each, which is
|
|
24
|
+
* the arrangement this folder exists to end: two implementations of "which band
|
|
25
|
+
* is this number in" is two chances to disagree about a boundary, on the two
|
|
26
|
+
* components a dashboard is most likely to draw side by side.
|
|
27
|
+
*
|
|
28
|
+
* Written as a scan rather than a sort so the array is read in the order it was
|
|
29
|
+
* given: thresholds are meant to be listed in ascending order, and silently
|
|
30
|
+
* reordering them would hide the one call site that did not.
|
|
31
|
+
*/
|
|
32
|
+
export declare function thresholdColor(value: number, color: NebaColor, thresholds: readonly NebaThreshold[] | undefined): NebaColor;
|
|
20
33
|
/**
|
|
21
34
|
* The props all three indicators take.
|
|
22
35
|
*
|
|
@@ -73,6 +86,16 @@ export declare function progressSlots(color: NebaColor): React.CSSProperties;
|
|
|
73
86
|
* a rule between two paragraphs, not a third of a button.
|
|
74
87
|
*/
|
|
75
88
|
export declare const barThicknessClasses: Record<NebaSize, string>;
|
|
89
|
+
/**
|
|
90
|
+
* How thick the line is, when a caller says so rather than the ladder.
|
|
91
|
+
*
|
|
92
|
+
* In pixels, because that is what the ring's arithmetic already works in and a
|
|
93
|
+
* bar and a ring should not take the number two different ways. `size` still
|
|
94
|
+
* decides everything else — the type scale beside the shape, the ring's
|
|
95
|
+
* diameter — so this is the one measurement pulled out of the step rather than
|
|
96
|
+
* a second size ladder.
|
|
97
|
+
*/
|
|
98
|
+
export type ProgressThickness = number;
|
|
76
99
|
/**
|
|
77
100
|
* The diameter of the ring, in pixels.
|
|
78
101
|
*
|