@cboxdk/cbox-ui 0.15.7 → 0.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1548,7 +1548,7 @@ type CheckboxProps = {
1548
1548
  */
1549
1549
  declare function Checkbox({ checked, onCheckedChange, label, hint, disabled, required, name, value, id: statedId, className }: CheckboxProps): react_jsx_runtime.JSX.Element;
1550
1550
 
1551
- type SheetSize = 'sm' | 'md' | 'lg';
1551
+ type SheetSize = 'sm' | 'md' | 'lg' | 'xl';
1552
1552
  type SheetProps = {
1553
1553
  open: boolean;
1554
1554
  onOpenChange: (open: boolean) => void;
@@ -1557,7 +1557,10 @@ type SheetProps = {
1557
1557
  description?: ReactNode;
1558
1558
  /** The buttons, right-aligned in a footer that stays in view. Cancel first, the action last. */
1559
1559
  footer?: ReactNode;
1560
- /** The panel's width on a wide screen: 26rem, 30rem (default) or 44rem. A phone's sheet is full width. */
1560
+ /**
1561
+ * The panel's width on a wide screen: 26rem, 30rem (default), 44rem, or 72rem for work that needs
1562
+ * room beside its controls, such as an editor with a live preview. A phone's sheet is full width.
1563
+ */
1561
1564
  size?: SheetSize;
1562
1565
  /** Clicking the scrim (or dragging the phone's sheet down) closes it (default). Off for a form that would lose typed work. */
1563
1566
  dismissible?: boolean;
@@ -1692,6 +1695,31 @@ type SpinnerProps = {
1692
1695
  */
1693
1696
  declare function Spinner({ className, label }: SpinnerProps): react_jsx_runtime.JSX.Element;
1694
1697
 
1698
+ type SliderProps = {
1699
+ value: number;
1700
+ onValueChange: (value: number) => void;
1701
+ min?: number;
1702
+ max?: number;
1703
+ step?: number;
1704
+ disabled?: boolean;
1705
+ name?: string;
1706
+ id?: string;
1707
+ /** What a screen reader says for the value, such as "40 percent"; the number when omitted. */
1708
+ valueText?: (value: number) => string;
1709
+ /** Required when the slider has no `<Field>` label. */
1710
+ 'aria-label'?: string;
1711
+ 'aria-labelledby'?: string;
1712
+ 'aria-describedby'?: string;
1713
+ className?: string;
1714
+ };
1715
+ /**
1716
+ * A value in a range, moved by pointer, arrow keys, Page Up/Down and Home/End. It is a native
1717
+ * `<input type="range">`, so touch, keyboard and assistive technology work as the platform does;
1718
+ * the track is filled up to the value. Inside a `<Field>` the Field's label names it. Show the
1719
+ * number beside it when the exact value matters.
1720
+ */
1721
+ declare const Slider: react.ForwardRefExoticComponent<SliderProps & react.RefAttributes<HTMLInputElement>>;
1722
+
1695
1723
  type SwitchProps = {
1696
1724
  checked: boolean;
1697
1725
  onCheckedChange: (checked: boolean) => void;
@@ -1957,4 +1985,4 @@ declare function Sparkline({ values, color, width, height }: {
1957
1985
  height?: number;
1958
1986
  }): react_jsx_runtime.JSX.Element | null;
1959
1987
 
1960
- export { APP_HUES, AppContent, type AppKey, AppShell, Button, type ButtonProps, type ButtonSize, type ButtonVariant, CHART_PALETTE, CboxAppCatalog, type CboxAppCatalogProps, CboxAppIcon, type CboxAppIconProps, type CboxAppKey, type CboxAppLink, CboxBrand, type CboxBrandProps, type CboxIdContextValue, CboxIdProvider, CboxKnownApp, CboxLocalizationProvider, type CboxNotificationPreviewItem, type CboxNotificationsState, type CboxOrganization, CboxServiceMark, type CboxServiceMarkProps, CboxShell, type CboxShellProps, CboxSurfaces, type CboxSurfacesProps, type CboxTranslationValues, type CboxTranslator, type CboxUser, Checkbox, type CheckboxProps, Combobox, type ComboboxAvatar, type ComboboxGroup, type ComboboxOption, type ComboboxProps, type ContextItem, type ContextLevel, type ContextTone, CreateField, CreateForm, CreateRefField, CreateSubmit, DataPanel, Dialog, DialogClose, type DialogProps, type DialogSize, EmptyState, Field, type FieldControlProps, type FieldProps, Heading, type HelpArticle, type HelpState, type HelpStore, type InboxState, type InferUrlState, Input, type InputProps, KeyValue, KeyValueList, type ListPage, type NavArea, type NavPage, PageHeader, type PageIntent, PageShell, type PageTabSpec, PageTabs, type PageTabsProps, type PageWidth, type PaletteAction, type PaletteRecord, PanelBody, RadioGroup, type RadioGroupProps, type RadioOption, type RealtimeState, type RealtimeStatus, RowLink, type RowLinkProps, SHELL_ICONS, SectionHeader, Sheet, SheetClose, type SheetProps, type SheetSize, type Shell, type ShellAccount, type Link as ShellActionLink, type ShellApp, type ShellBanner, type ShellCatalogState, type ShellCreatable, type ShellCreate, type ShellCreateForm, type ShellCreated, type ShellHelp, type ShellHelpArticle, type ShellIcon, type ShellLinkComponent, type ShellNavigate, type ShellNotifications, type ShellOption, type ShellPreferenceChange, type ShellPreferences, type ShellRecordSearch, type ShellRenderCreate, type ShellTheme, Sparkline, Spinner, type SpinnerProps, StatTile, StatusPill, type SupportUpdate, type SurfaceArgs, type SurfaceConfig, type SurfaceController, type SurfaceId, Switch, type SwitchBody, type SwitchProps, Textarea, type TextareaProps, type Transport, type UrlField, type UrlSchema, applyTheme, buildUrlSearch, buttonClassName, cn, contextTrail, createHelpStore, defineUrlSchema, environmentFor, groupItems, hueFor, initialsOf, interpolate, isLive, pageIntent, parseListPage, parseShellCatalog, parseUrlSearch, quickEnvironments, settingsHref, switchBody, switchPayload, themeBootScript, urlBoolean, urlEnum, urlNumber, urlString, urlStringArray, useCboxId, useCboxIdOptional, useCboxLocalization, useCboxSurfaces, useCboxSurfacesOptional, useDialogClose, useFieldControl, useKnownAppCatalog, useSheetClose, useShellCreate, useShellHelp, useShellPageTitle, withQuery };
1988
+ export { APP_HUES, AppContent, type AppKey, AppShell, Button, type ButtonProps, type ButtonSize, type ButtonVariant, CHART_PALETTE, CboxAppCatalog, type CboxAppCatalogProps, CboxAppIcon, type CboxAppIconProps, type CboxAppKey, type CboxAppLink, CboxBrand, type CboxBrandProps, type CboxIdContextValue, CboxIdProvider, CboxKnownApp, CboxLocalizationProvider, type CboxNotificationPreviewItem, type CboxNotificationsState, type CboxOrganization, CboxServiceMark, type CboxServiceMarkProps, CboxShell, type CboxShellProps, CboxSurfaces, type CboxSurfacesProps, type CboxTranslationValues, type CboxTranslator, type CboxUser, Checkbox, type CheckboxProps, Combobox, type ComboboxAvatar, type ComboboxGroup, type ComboboxOption, type ComboboxProps, type ContextItem, type ContextLevel, type ContextTone, CreateField, CreateForm, CreateRefField, CreateSubmit, DataPanel, Dialog, DialogClose, type DialogProps, type DialogSize, EmptyState, Field, type FieldControlProps, type FieldProps, Heading, type HelpArticle, type HelpState, type HelpStore, type InboxState, type InferUrlState, Input, type InputProps, KeyValue, KeyValueList, type ListPage, type NavArea, type NavPage, PageHeader, type PageIntent, PageShell, type PageTabSpec, PageTabs, type PageTabsProps, type PageWidth, type PaletteAction, type PaletteRecord, PanelBody, RadioGroup, type RadioGroupProps, type RadioOption, type RealtimeState, type RealtimeStatus, RowLink, type RowLinkProps, SHELL_ICONS, SectionHeader, Sheet, SheetClose, type SheetProps, type SheetSize, type Shell, type ShellAccount, type Link as ShellActionLink, type ShellApp, type ShellBanner, type ShellCatalogState, type ShellCreatable, type ShellCreate, type ShellCreateForm, type ShellCreated, type ShellHelp, type ShellHelpArticle, type ShellIcon, type ShellLinkComponent, type ShellNavigate, type ShellNotifications, type ShellOption, type ShellPreferenceChange, type ShellPreferences, type ShellRecordSearch, type ShellRenderCreate, type ShellTheme, Slider, type SliderProps, Sparkline, Spinner, type SpinnerProps, StatTile, StatusPill, type SupportUpdate, type SurfaceArgs, type SurfaceConfig, type SurfaceController, type SurfaceId, Switch, type SwitchBody, type SwitchProps, Textarea, type TextareaProps, type Transport, type UrlField, type UrlSchema, applyTheme, buildUrlSearch, buttonClassName, cn, contextTrail, createHelpStore, defineUrlSchema, environmentFor, groupItems, hueFor, initialsOf, interpolate, isLive, pageIntent, parseListPage, parseShellCatalog, parseUrlSearch, quickEnvironments, settingsHref, switchBody, switchPayload, themeBootScript, urlBoolean, urlEnum, urlNumber, urlString, urlStringArray, useCboxId, useCboxIdOptional, useCboxLocalization, useCboxSurfaces, useCboxSurfacesOptional, useDialogClose, useFieldControl, useKnownAppCatalog, useSheetClose, useShellCreate, useShellHelp, useShellPageTitle, withQuery };
package/dist/index.js CHANGED
@@ -5902,6 +5902,28 @@ function RadioGroup({ value, onValueChange, options, label, labelHidden = false,
5902
5902
  }) })
5903
5903
  ] });
5904
5904
  }
5905
+ var Slider = forwardRef(function Slider2({ value, onValueChange, min = 0, max = 100, step = 1, disabled = false, valueText, className, ...props }, ref) {
5906
+ const { required: _required, ...wiring } = useFieldControl();
5907
+ const fill = max > min ? (Math.min(Math.max(value, min), max) - min) / (max - min) * 100 : 0;
5908
+ return /* @__PURE__ */ jsx(
5909
+ "input",
5910
+ {
5911
+ ref,
5912
+ type: "range",
5913
+ min,
5914
+ max,
5915
+ step,
5916
+ value,
5917
+ disabled,
5918
+ "aria-valuetext": valueText?.(value),
5919
+ className: cn("cbx-ui-slider", className),
5920
+ style: { "--cbx-ui-slider-fill": `${fill}%` },
5921
+ onChange: (event) => onValueChange(Number(event.currentTarget.value)),
5922
+ ...wiring,
5923
+ ...props
5924
+ }
5925
+ );
5926
+ });
5905
5927
  var Switch = forwardRef(function Switch2({ checked, onCheckedChange, disabled = false, name, className, ...props }, ref) {
5906
5928
  const field = useFieldControl();
5907
5929
  const { required: _required, ...wiring } = field;
@@ -6415,6 +6437,6 @@ function Sparkline({ values, color = "var(--chart-1)", width = 90, height = 20 }
6415
6437
  ] });
6416
6438
  }
6417
6439
 
6418
- export { APP_HUES, AppContent, AppShell, Button, CHART_PALETTE, CboxAppCatalog, CboxAppIcon, CboxBrand, CboxIdProvider, CboxLocalizationProvider, CboxServiceMark, CboxShell, CboxSurfaces, Checkbox, Combobox, CreateField, CreateForm, CreateRefField, CreateSubmit, DataPanel, Dialog, DialogClose, EmptyState, Field, Heading, Input, KeyValue, KeyValueList, PageHeader, PageShell, PageTabs, PanelBody, RadioGroup, RowLink, SHELL_ICONS, SectionHeader, Sheet, SheetClose, Sparkline, Spinner, StatTile, StatusPill, Switch, Textarea, applyTheme, buildUrlSearch, buttonClassName, contextTrail, createHelpStore, defineUrlSchema, environmentFor, groupItems, hueFor, initialsOf, interpolate, isLive, pageIntent, parseListPage, parseShellCatalog, parseUrlSearch, quickEnvironments, settingsHref, switchBody, switchPayload, themeBootScript, urlBoolean, urlEnum, urlNumber, urlString, urlStringArray, useCboxId, useCboxIdOptional, useCboxLocalization, useCboxSurfaces, useCboxSurfacesOptional, useDialogClose, useFieldControl, useKnownAppCatalog, useSheetClose, useShellCreate, useShellHelp, useShellPageTitle, withQuery };
6440
+ export { APP_HUES, AppContent, AppShell, Button, CHART_PALETTE, CboxAppCatalog, CboxAppIcon, CboxBrand, CboxIdProvider, CboxLocalizationProvider, CboxServiceMark, CboxShell, CboxSurfaces, Checkbox, Combobox, CreateField, CreateForm, CreateRefField, CreateSubmit, DataPanel, Dialog, DialogClose, EmptyState, Field, Heading, Input, KeyValue, KeyValueList, PageHeader, PageShell, PageTabs, PanelBody, RadioGroup, RowLink, SHELL_ICONS, SectionHeader, Sheet, SheetClose, Slider, Sparkline, Spinner, StatTile, StatusPill, Switch, Textarea, applyTheme, buildUrlSearch, buttonClassName, contextTrail, createHelpStore, defineUrlSchema, environmentFor, groupItems, hueFor, initialsOf, interpolate, isLive, pageIntent, parseListPage, parseShellCatalog, parseUrlSearch, quickEnvironments, settingsHref, switchBody, switchPayload, themeBootScript, urlBoolean, urlEnum, urlNumber, urlString, urlStringArray, useCboxId, useCboxIdOptional, useCboxLocalization, useCboxSurfaces, useCboxSurfacesOptional, useDialogClose, useFieldControl, useKnownAppCatalog, useSheetClose, useShellCreate, useShellHelp, useShellPageTitle, withQuery };
6419
6441
  //# sourceMappingURL=index.js.map
6420
6442
  //# sourceMappingURL=index.js.map