@panneau/ui 5.0.0-alpha.7 → 5.0.0-alpha.9

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.
Files changed (97) hide show
  1. package/README.md +17 -0
  2. package/dist/alert/Alert.d.ts +2 -2
  3. package/dist/alert/tokens.d.ts +1 -1
  4. package/dist/badge/Badge.d.ts +1 -1
  5. package/dist/badge/tokens.d.ts +1 -1
  6. package/dist/button/Button.d.ts +3 -3
  7. package/dist/button/tokens.d.ts +1 -1
  8. package/dist/card/tokens.d.ts +1 -1
  9. package/dist/checkbox/Checkbox.d.ts +1 -1
  10. package/dist/checkbox/tokens.d.ts +1 -1
  11. package/dist/combo-box/ComboBox.d.ts +1 -1
  12. package/dist/command-palette/CommandPalette.d.ts +1 -1
  13. package/dist/command-palette/match.d.ts +1 -1
  14. package/dist/command-palette/tokens.d.ts +1 -1
  15. package/dist/container/tokens.d.ts +1 -1
  16. package/dist/date-picker/DatePicker.d.ts +1 -1
  17. package/dist/date-picker/calendarTokens.d.ts +1 -1
  18. package/dist/dialog/Dialog.css +5 -0
  19. package/dist/dialog/Dialog.d.ts.map +1 -1
  20. package/dist/dialog/Dialog.js +9 -4
  21. package/dist/dialog/Dialog.js.map +1 -1
  22. package/dist/dialog/Dialog.module.js +4 -2
  23. package/dist/dialog/Dialog.module.js.map +1 -1
  24. package/dist/dialog/tokens.d.ts +1 -1
  25. package/dist/disclosure/tokens.d.ts +1 -1
  26. package/dist/divider/tokens.d.ts +1 -1
  27. package/dist/field/FieldParts.d.ts +1 -1
  28. package/dist/field/inputTokens.d.ts +1 -1
  29. package/dist/field/tokens.d.ts +1 -1
  30. package/dist/grid/Grid.d.ts +1 -1
  31. package/dist/grid/tokens.d.ts +1 -1
  32. package/dist/heading/tokens.d.ts +1 -1
  33. package/dist/icon/lucideIconLoader.d.ts +1 -1
  34. package/dist/icon/namedIcons.d.ts +1 -1
  35. package/dist/icon-button/IconButton.d.ts +2 -2
  36. package/dist/index.d.ts +61 -61
  37. package/dist/inline/Inline.d.ts +1 -1
  38. package/dist/inline/tokens.d.ts +1 -1
  39. package/dist/menu/Menu.d.ts +1 -1
  40. package/dist/menu/tokens.d.ts +1 -1
  41. package/dist/named-icons/index.d.ts +1 -1
  42. package/dist/number-input/NumberInput.d.ts +1 -1
  43. package/dist/number-input/tokens.d.ts +1 -1
  44. package/dist/pill-trigger/tokens.d.ts +1 -1
  45. package/dist/popover/Popover.css +5 -0
  46. package/dist/popover/Popover.d.ts.map +1 -1
  47. package/dist/popover/Popover.js +9 -4
  48. package/dist/popover/Popover.js.map +1 -1
  49. package/dist/popover/Popover.module.js +4 -2
  50. package/dist/popover/Popover.module.js.map +1 -1
  51. package/dist/popover/tokens.d.ts +1 -1
  52. package/dist/prose/tokens.d.ts +1 -1
  53. package/dist/radio-group/RadioGroup.d.ts +2 -2
  54. package/dist/radio-group/tokens.d.ts +1 -1
  55. package/dist/root/PanneauRoot.d.ts +27 -5
  56. package/dist/root/PanneauRoot.d.ts.map +1 -1
  57. package/dist/root/PanneauRoot.js +164 -120
  58. package/dist/root/PanneauRoot.js.map +1 -1
  59. package/dist/root/ThemeScope.d.ts +1 -1
  60. package/dist/root/ThemeScope.d.ts.map +1 -1
  61. package/dist/root/ThemeScope.js +40 -38
  62. package/dist/root/ThemeScope.js.map +1 -1
  63. package/dist/segmented-control/SegmentedControl.d.ts +1 -1
  64. package/dist/segmented-control/tokens.d.ts +1 -1
  65. package/dist/select/Select.d.ts +1 -1
  66. package/dist/select/listBoxTokens.d.ts +1 -1
  67. package/dist/skeleton/tokens.d.ts +1 -1
  68. package/dist/slider/Slider.d.ts +1 -1
  69. package/dist/spinner/tokens.d.ts +1 -1
  70. package/dist/stack/Stack.d.ts +1 -1
  71. package/dist/stack/tokens.d.ts +1 -1
  72. package/dist/switch/Switch.d.ts +1 -1
  73. package/dist/switch/tokens.d.ts +1 -1
  74. package/dist/tabs/tokens.d.ts +1 -1
  75. package/dist/tags-input/TagsInput.d.ts +1 -1
  76. package/dist/text/Text.d.ts +1 -1
  77. package/dist/text/tokens.d.ts +1 -1
  78. package/dist/text-area/TextArea.d.ts +1 -1
  79. package/dist/text-input/TextInput.d.ts +1 -1
  80. package/dist/theme/bootstrap.d.ts +2 -2
  81. package/dist/theme/checkTheme.d.ts +2 -2
  82. package/dist/theme/cli.d.ts +2 -2
  83. package/dist/theme/colorVision.d.ts +1 -1
  84. package/dist/theme/defineTheme.d.ts +5 -5
  85. package/dist/theme/index.d.ts +12 -12
  86. package/dist/theme/theme.d.ts +2 -2
  87. package/dist/theme/toneClass.d.ts +1 -1
  88. package/dist/theme/tones.d.ts +1 -1
  89. package/dist/time-input/TimeInput.d.ts +1 -1
  90. package/dist/toast/Toast.d.ts +1 -1
  91. package/dist/toast/tokens.d.ts +1 -1
  92. package/dist/tooltip/tokens.d.ts +1 -1
  93. package/dist/utils/events.d.ts +4 -0
  94. package/dist/utils/events.d.ts.map +1 -0
  95. package/dist/utils/events.js +9 -0
  96. package/dist/utils/events.js.map +1 -0
  97. package/package.json +5 -5
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeScope.js","names":["HTMLAttributes","ReactNode","use","useState","ColorScheme","Density","Theme","cx","PortalProvider","ScopeContext","useThemeStyles","styles","ThemeScopeProps","HTMLElement","as","theme","colorScheme","density","children","ThemeScope","t0","$","_c","className","props","t1","t2","Element","undefined","parent","container","setContainer","scope","themeStyles","t3","t4","t5","effective","t6","scheme","t7","t8","t9","t10","t11","Symbol","for","portal","t12","_c","styles"],"sources":["../../src/root/ThemeScope.tsx"],"sourcesContent":["import { type HTMLAttributes, type ReactNode, use, useState } from 'react';\n\nimport type { ColorScheme, Density, Theme } from '../theme/theme';\nimport { cx } from '../utils/cx';\nimport { PortalProvider, ScopeContext, useThemeStyles } from './PanneauRoot';\nimport styles from './PanneauRoot.module.css';\n\nexport interface ThemeScopeProps extends HTMLAttributes<HTMLElement> {\n /** Element to render. Defaults to `div`. */\n as?: 'div' | 'section' | 'aside' | 'nav' | 'header' | 'footer' | 'main' | 'article';\n /** A theme for the subtree, over the theme of the root. */\n theme?: Theme | null;\n /** A color scheme for the subtree. Inherited by default. */\n colorScheme?: ColorScheme;\n /** A density for the subtree. Inherited by default. */\n density?: Density;\n children?: ReactNode;\n}\n\n/**\n * Applies a theme, a color scheme or a density to a subtree, like `data-bs-theme` on any element:\n * a dark sidebar in a light app, a compact table, a preview in another brand's colors. Overlays\n * opened inside it render in its own container, so that they keep its tokens. It must be inside a\n * `PanneauRoot`.\n *\n * What it doesn't set comes from its parent: a scope with only a density keeps the colors of the\n * theme around it.\n */\nexport function ThemeScope({\n as: Element = 'div',\n theme = null,\n colorScheme,\n density,\n className,\n children,\n ...props\n}: ThemeScopeProps) {\n const parent = use(ScopeContext);\n const [container, setContainer] = useState<HTMLDivElement | null>(null);\n const { scope, styles: themeStyles } = useThemeStyles(theme);\n // The effective values are always written, so that the dark and density rules of a theme apply.\n // Only those set here take the default tokens back (`.scheme`, `.density`).\n const effective = {\n colorScheme: colorScheme ?? parent.colorScheme,\n density: density ?? parent.density,\n };\n return (\n <Element\n {...props}\n className={cx(\n 'panneau-theme-scope',\n styles.scope,\n colorScheme !== undefined && styles.scheme,\n density !== undefined && styles.density,\n className,\n )}\n data-color-scheme={effective.colorScheme}\n data-density={effective.density}\n data-panneau-theme={scope}\n >\n {themeStyles}\n <ScopeContext value={effective}>\n <PortalProvider value={container}>{children}</PortalProvider>\n </ScopeContext>\n <div ref={setContainer} className={styles.portal} />\n </Element>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA4BA,SAAOmB,WAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAJ;CAAA,IAAAK;CAAA,IAAAP;CAAA,IAAAC;CAAA,IAAAO;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAL,EAAA,OAAAD,IAAA;EAAoB,CAAA,CAAAN,IAAAW,IAAAV,OAAAW,IAAAV,aAAAC,SAAAM,WAAAL,U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;EAAApB,EAAA,MAAAY;EAAAZ,EAAA,MAAA2B;CAAA,OAAAA,MAAA3B,EAAA;CAAA,OAlBV2B;AAkBU"}
1
+ {"version":3,"file":"ThemeScope.js","names":["HTMLAttributes","ReactNode","use","useState","ColorScheme","Density","Theme","cx","PortalProvider","ScopeContext","useThemeStyles","styles","ThemeScopeProps","HTMLElement","as","theme","colorScheme","density","children","ThemeScope","t0","$","_c","className","props","t1","t2","Element","undefined","parent","container","setContainer","scope","themeStyles","nonce","t3","t4","t5","effective","t6","scheme","t7","t8","t9","t10","t11","Symbol","for","portal","t12","_c","styles"],"sources":["../../src/root/ThemeScope.tsx"],"sourcesContent":["import { type HTMLAttributes, type ReactNode, use, useState } from 'react';\n\nimport type { ColorScheme, Density, Theme } from '../theme/theme';\nimport { cx } from '../utils/cx';\nimport { PortalProvider, ScopeContext, useThemeStyles } from './PanneauRoot';\nimport styles from './PanneauRoot.module.css';\n\nexport interface ThemeScopeProps extends HTMLAttributes<HTMLElement> {\n /** Element to render. Defaults to `div`. */\n as?: 'div' | 'section' | 'aside' | 'nav' | 'header' | 'footer' | 'main' | 'article';\n /** A theme for the subtree, over the theme of the root. */\n theme?: Theme | null;\n /** A color scheme for the subtree. Inherited by default. */\n colorScheme?: ColorScheme;\n /** A density for the subtree. Inherited by default. */\n density?: Density;\n children?: ReactNode;\n}\n\n/**\n * Applies a theme, a color scheme or a density to a subtree, like `data-bs-theme` on any element:\n * a dark sidebar in a light app, a compact table, a preview in another brand's colors. Overlays\n * opened inside it render in its own container, so that they keep its tokens. It must be inside a\n * `PanneauRoot`.\n *\n * What it doesn't set comes from its parent: a scope with only a density keeps the colors of the\n * theme around it.\n */\nexport function ThemeScope({\n as: Element = 'div',\n theme = null,\n colorScheme,\n density,\n className,\n children,\n ...props\n}: ThemeScopeProps) {\n const parent = use(ScopeContext);\n const [container, setContainer] = useState<HTMLDivElement | null>(null);\n const { scope, styles: themeStyles } = useThemeStyles(theme, parent.nonce);\n // The effective values are always written, so that the dark and density rules of a theme apply.\n // Only those set here take the default tokens back (`.scheme`, `.density`).\n const effective = {\n colorScheme: colorScheme ?? parent.colorScheme,\n density: density ?? parent.density,\n nonce: parent.nonce,\n };\n return (\n <Element\n {...props}\n className={cx(\n 'panneau-theme-scope',\n styles.scope,\n colorScheme !== undefined && styles.scheme,\n density !== undefined && styles.density,\n className,\n )}\n data-color-scheme={effective.colorScheme}\n data-density={effective.density}\n data-panneau-theme={scope}\n >\n {themeStyles}\n <ScopeContext value={effective}>\n <PortalProvider value={container}>{children}</PortalProvider>\n </ScopeContext>\n <div ref={setContainer} className={styles.portal} />\n </Element>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA4BA,SAAOmB,WAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAJ;CAAA,IAAAK;CAAA,IAAAP;CAAA,IAAAC;CAAA,IAAAO;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAL,EAAA,OAAAD,IAAA;EAAoB,CAAA,CAAAN,IAAAW,IAAAV,OAAAW,IAAAV,aAAAC,SAAAM,WAAAL,UAAA,GAAAM,SAAAJ;EAQTC,EAAA,KAAAD;EAAAC,EAAA,KAAAH;EAAAG,EAAA,KAAAE;EAAAF,EAAA,KAAAL;EAAAK,EAAA,KAAAJ;EAAAI,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;CAAA,OAAA;EAAAR,WAAAG,EAAA;EAAAE,YAAAF,EAAA;EAAAL,cAAAK,EAAA;EAAAJ,UAAAI,EAAA;EAAAG,QAAAH,EAAA;EAAAI,KAAAJ,EAAA;EAAAK,KAAAL,EAAA;CAAA;CAPV,MAAAM,UAAAF,OAAAG,KAAAA,IAAA,QAAAH;CACJ,MAAAV,QAAAW,OAAAE,KAAAA,IAAA,OAAAF;CAOA,MAAAG,SAAe3B,IAAIO,YAAY;CAC/B,MAAA,CAAAqB,WAAAC,gBAAkC5B,SAAgC,IAAI;CACtE,MAAA,EA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B;EAAAtB,EAAA,MAAAuB;CAAA,OAAAA,MAAAvB,EAAA;CAAA,IAAAwB;CAAA,IAAAxB,EAAA,QAAAyB,OAAAC,IAAA,2BAAA,GAAA;EACfF,MAAA,oBAAA,OAAA;GAAUd,KAAAA;GAAyB,WAAApB,2BAAMqC;EAAO,CAAA;EAAI3B,EAAA,MAAAwB;CAAA,OAAAA,MAAAxB,EAAA;CAAA,IAAA4B;CAAA,IAAA5B,EAAA,QAAAM,WAAAN,EAAA,QAAAiB,UAAAtB,eAAAK,EAAA,QAAAiB,UAAArB,WAAAI,EAAA,QAAAG,SAAAH,EAAA,QAAAW,SAAAX,EAAA,QAAAuB,OAAAvB,EAAA,QAAAqB,MAAArB,EAAA,QAAAY,aAAA;EAjBxDgB,MAAA,qBAAC,SAAD;GAAQ,GACAzB;GACO,WAAAkB;GAOQ,qBAAAJ,UAAStB;GACd,gBAAAsB,UAASrB;GACHe,sBAAAA;GAXxB,UAAA;IAaKC;IACDW;IAGAC;GAjBI;;EAkBExB,EAAA,MAAAM;EAAAN,EAAA,MAAAiB,UAAAtB;EAAAK,EAAA,MAAAiB,UAAArB;EAAAI,EAAA,MAAAG;EAAAH,EAAA,MAAAW;EAAAX,EAAA,MAAAuB;EAAAvB,EAAA,MAAAqB;EAAArB,EAAA,MAAAY;EAAAZ,EAAA,MAAA4B;CAAA,OAAAA,MAAA5B,EAAA;CAAA,OAlBV4B;AAkBU"}
@@ -1,5 +1,5 @@
1
1
  import { type ReactNode } from 'react';
2
- import { type IconComponent } from '../icon/Icon';
2
+ import { type IconComponent } from '../icon/Icon.js';
3
3
  /** One choice of a segmented control. */
4
4
  export interface SegmentedControlOption {
5
5
  value: string;
@@ -1,3 +1,3 @@
1
1
  /** Tokens of SegmentedControl. */
2
- export declare const segmentedControlTokens: import("..").ComponentTokens<"segmented-control", "panneau-segmented-control-radius" | "panneau-segmented-control-padding" | "panneau-segmented-control-bg" | "panneau-segmented-control-border-color" | "panneau-segmented-control-segment-padding-x" | "panneau-segmented-control-segment-font-weight" | "panneau-segmented-control-segment-color" | "panneau-segmented-control-segment-color-selected" | "panneau-segmented-control-segment-bg-selected" | "panneau-segmented-control-segment-shadow-selected">;
2
+ export declare const segmentedControlTokens: import("../index.js").ComponentTokens<"segmented-control", "panneau-segmented-control-radius" | "panneau-segmented-control-padding" | "panneau-segmented-control-bg" | "panneau-segmented-control-border-color" | "panneau-segmented-control-segment-padding-x" | "panneau-segmented-control-segment-font-weight" | "panneau-segmented-control-segment-color" | "panneau-segmented-control-segment-color-selected" | "panneau-segmented-control-segment-bg-selected" | "panneau-segmented-control-segment-shadow-selected">;
3
3
  //# sourceMappingURL=tokens.d.ts.map
@@ -1,4 +1,4 @@
1
- import { type FieldChromeProps } from '../field/FieldParts';
1
+ import { type FieldChromeProps } from '../field/FieldParts.js';
2
2
  /** The value of an option. */
3
3
  export type OptionValue = string | number | boolean;
4
4
  /** A choice of a select, a radio group or a combo box. Same shape as the protocol's `Option`. */
@@ -1,3 +1,3 @@
1
1
  /** Tokens of the options of `Select`, `ComboBox` and `Menu`. */
2
- export declare const listBoxTokens: import("..").ComponentTokens<"list-box", "panneau-list-box-padding" | "panneau-list-box-item-radius" | "panneau-list-box-item-padding-y" | "panneau-list-box-item-padding-y-described" | "panneau-list-box-item-padding-x" | "panneau-list-box-item-bg-hover">;
2
+ export declare const listBoxTokens: import("../index.js").ComponentTokens<"list-box", "panneau-list-box-padding" | "panneau-list-box-item-radius" | "panneau-list-box-item-padding-y" | "panneau-list-box-item-padding-y-described" | "panneau-list-box-item-padding-x" | "panneau-list-box-item-bg-hover">;
3
3
  //# sourceMappingURL=listBoxTokens.d.ts.map
@@ -1,3 +1,3 @@
1
1
  /** Tokens of Skeleton. */
2
- export declare const skeletonTokens: import("..").ComponentTokens<"skeleton", "panneau-skeleton-color" | "panneau-skeleton-radius" | "panneau-skeleton-duration">;
2
+ export declare const skeletonTokens: import("../index.js").ComponentTokens<"skeleton", "panneau-skeleton-color" | "panneau-skeleton-radius" | "panneau-skeleton-duration">;
3
3
  //# sourceMappingURL=tokens.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import { type SliderProps as AriaSliderProps } from 'react-aria-components';
3
- import { type FieldChromeProps } from '../field/FieldParts';
3
+ import { type FieldChromeProps } from '../field/FieldParts.js';
4
4
  export interface SliderProps extends Omit<AriaSliderProps<number>, 'className' | 'style' | 'children' | 'value' | 'defaultValue' | 'onChange'>, FieldChromeProps {
5
5
  /** The number, or `null` until the slider is moved: the thumb then rests at the start. */
6
6
  value?: number | null;
@@ -1,3 +1,3 @@
1
1
  /** Tokens of Spinner. */
2
- export declare const spinnerTokens: import("..").ComponentTokens<"spinner", "panneau-spinner-border-width">;
2
+ export declare const spinnerTokens: import("../index.js").ComponentTokens<"spinner", "panneau-spinner-border-width">;
3
3
  //# sourceMappingURL=tokens.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import type { HTMLAttributes } from 'react';
2
- import { type Justification, type Responsive, type Space } from '../layout/responsive';
2
+ import { type Justification, type Responsive, type Space } from '../layout/responsive.js';
3
3
  export interface StackProps extends HTMLAttributes<HTMLElement> {
4
4
  /** Element to render. Defaults to `div`. */
5
5
  as?: 'div' | 'section' | 'article' | 'aside' | 'header' | 'footer' | 'nav' | 'main' | 'ul' | 'ol' | 'form';
@@ -1,3 +1,3 @@
1
1
  /** Tokens of Stack. */
2
- export declare const stackTokens: import("..").ComponentTokens<"stack", "panneau-stack-gap">;
2
+ export declare const stackTokens: import("../index.js").ComponentTokens<"stack", "panneau-stack-gap">;
3
3
  //# sourceMappingURL=tokens.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import { type SwitchProps as AriaSwitchProps } from 'react-aria-components';
3
- import { type ChoiceChromeProps } from '../checkbox/ChoiceChrome';
3
+ import { type ChoiceChromeProps } from '../checkbox/ChoiceChrome.js';
4
4
  export interface SwitchProps extends Omit<AriaSwitchProps, 'className' | 'style' | 'children'>, ChoiceChromeProps {
5
5
  /** Label, next to the switch. */
6
6
  children?: ReactNode;
@@ -1,3 +1,3 @@
1
1
  /** Tokens of Switch. */
2
- export declare const switchTokens: import("..").ComponentTokens<"switch", "panneau-switch-height" | "panneau-switch-width" | "panneau-switch-radius" | "panneau-switch-checked-bg" | "panneau-switch-track-bg" | "panneau-switch-thumb-size" | "panneau-switch-thumb-bg" | "panneau-switch-checked-thumb-bg">;
2
+ export declare const switchTokens: import("../index.js").ComponentTokens<"switch", "panneau-switch-height" | "panneau-switch-width" | "panneau-switch-radius" | "panneau-switch-checked-bg" | "panneau-switch-track-bg" | "panneau-switch-thumb-size" | "panneau-switch-thumb-bg" | "panneau-switch-checked-thumb-bg">;
3
3
  //# sourceMappingURL=tokens.d.ts.map
@@ -1,3 +1,3 @@
1
1
  /** Tokens of Tabs. */
2
- export declare const tabsTokens: import("..").ComponentTokens<"tabs", "panneau-tabs-gap" | "panneau-tabs-border-color" | "panneau-tabs-tab-padding-x" | "panneau-tabs-tab-font-weight" | "panneau-tabs-tab-color" | "panneau-tabs-indicator-height" | "panneau-tabs-tab-color-selected" | "panneau-tabs-indicator-color">;
2
+ export declare const tabsTokens: import("../index.js").ComponentTokens<"tabs", "panneau-tabs-gap" | "panneau-tabs-border-color" | "panneau-tabs-tab-padding-x" | "panneau-tabs-tab-font-weight" | "panneau-tabs-tab-color" | "panneau-tabs-indicator-height" | "panneau-tabs-tab-color-selected" | "panneau-tabs-indicator-color">;
3
3
  //# sourceMappingURL=tokens.d.ts.map
@@ -1,4 +1,4 @@
1
- import { type FieldChromeProps } from '../field/FieldParts';
1
+ import { type FieldChromeProps } from '../field/FieldParts.js';
2
2
  /** A suggested tag: its value, and the label shown for it. */
3
3
  export interface TagSuggestion {
4
4
  value: string;
@@ -1,5 +1,5 @@
1
1
  import type { HTMLAttributes } from 'react';
2
- import type { Tone } from '../theme/tones';
2
+ import type { Tone } from '../theme/tones.js';
3
3
  /** A size of the font scale of the theme. */
4
4
  export type TextSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
5
5
  /** A font role of the theme. */
@@ -1,3 +1,3 @@
1
1
  /** Tokens of Text. */
2
- export declare const textTokens: import("..").ComponentTokens<"text", "panneau-text-muted-color">;
2
+ export declare const textTokens: import("../index.js").ComponentTokens<"text", "panneau-text-muted-color">;
3
3
  //# sourceMappingURL=tokens.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { type TextFieldProps as AriaTextFieldProps } from 'react-aria-components';
2
- import { type FieldChromeProps } from '../field/FieldParts';
2
+ import { type FieldChromeProps } from '../field/FieldParts.js';
3
3
  export interface TextAreaProps extends Omit<AriaTextFieldProps, 'className' | 'style' | 'children' | 'isInvalid' | 'validate'>, FieldChromeProps {
4
4
  placeholder?: string;
5
5
  /** Visible lines of text. Defaults to 4. */
@@ -1,6 +1,6 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import { type TextFieldProps as AriaTextFieldProps } from 'react-aria-components';
3
- import { type FieldChromeProps } from '../field/FieldParts';
3
+ import { type FieldChromeProps } from '../field/FieldParts.js';
4
4
  export interface TextInputProps extends Omit<AriaTextFieldProps, 'className' | 'style' | 'children' | 'isInvalid' | 'validate' | 'type'>, FieldChromeProps {
5
5
  type?: 'text' | 'email' | 'url' | 'tel' | 'password' | 'search';
6
6
  placeholder?: string;
@@ -1,5 +1,5 @@
1
- import type { Theme } from './theme';
2
- import type { ToneValues } from './tones';
1
+ import type { Theme } from './theme.js';
2
+ import type { ToneValues } from './tones.js';
3
3
  /**
4
4
  * A tone from one of Bootstrap's theme colors, read from its CSS variables (`--bs-<color>`,
5
5
  * `-text-emphasis`, `-bg-subtle`, `-border-subtle`), so that a site's custom colors carry over:
@@ -1,5 +1,5 @@
1
- import { type ColorDifferenceCheck } from './colorVision';
2
- import { type Theme } from './theme';
1
+ import { type ColorDifferenceCheck } from './colorVision.js';
2
+ import { type Theme } from './theme.js';
3
3
  /** A pair of colors that a theme must keep readable. */
4
4
  export interface ThemeContrastCheck {
5
5
  scheme: 'light' | 'dark';
@@ -1,5 +1,5 @@
1
- import { type ThemeReport } from './checkTheme';
2
- import type { Theme } from './theme';
1
+ import { type ThemeReport } from './checkTheme.js';
2
+ import type { Theme } from './theme.js';
3
3
  /** Loads a module from its URL: `import()`, replaced in tests. */
4
4
  export type ModuleImporter = (url: string) => Promise<Record<string, unknown>>;
5
5
  /** Reads a theme from a JSON file or from an export of a module. */
@@ -1,4 +1,4 @@
1
- import { type Rgb } from './color';
1
+ import { type Rgb } from './color.js';
2
2
  /** A color vision deficiency, at full severity: red-blind, green-blind or blue-blind. */
3
3
  export type ColorVisionDeficiency = 'protanopia' | 'deuteranopia' | 'tritanopia';
4
4
  /** A color as a person with a color vision deficiency sees it. */
@@ -1,8 +1,8 @@
1
- import { type ComponentTokenName } from './components';
2
- import type { ThemeFont } from './fonts';
3
- import { type SemanticTokenName } from './semanticTokens';
4
- import type { Density, Theme } from './theme';
5
- import type { ToneInput } from './tones';
1
+ import { type ComponentTokenName } from './components.js';
2
+ import type { ThemeFont } from './fonts.js';
3
+ import { type SemanticTokenName } from './semanticTokens.js';
4
+ import type { Density, Theme } from './theme.js';
5
+ import type { ToneInput } from './tones.js';
6
6
  /**
7
7
  * Tokens that a project adds, such as those of its own components: declare them here so that
8
8
  * `defineTheme()` accepts them.
@@ -1,13 +1,13 @@
1
- export { bootstrapTheme, bootstrapTone } from './bootstrap';
2
- export { CHART_CATEGORICAL_COUNT, CHART_SEQUENTIAL_COUNT, chartColors } from './chartColors';
3
- export { type ThemeContrastCheck, type ThemeReport, checkTheme } from './checkTheme';
4
- export { type ColorDifferenceCheck, type ColorVisionDeficiency, checkColorDifferences, } from './colorVision';
5
- export { type Rgb } from './color';
6
- export { type ComponentTokens, defineComponentTokens } from './componentTokens';
7
- export { type ComponentTokenName, componentTokens } from './components';
8
- export { type PaletteTokenName, type PanneauTokens, type ThemeDefinition, type ThemeTokens, type TokenName, defineTheme, findUnknownTokens, mergeThemes, } from './defineTheme';
9
- export { type ThemeFont, type ThemeFontFace, type ThemeFontStylesheet } from './fonts';
10
- export { SEMANTIC_TOKENS, type SemanticTokenName } from './semanticTokens';
11
- export { type ColorScheme, type Density, type Theme } from './theme';
12
- export { BUILT_IN_TONES, type PanneauTones, type Tone, type ToneInput, type ToneSurfaces, type ToneValues, deriveTone, toneClassName, } from './tones';
1
+ export { bootstrapTheme, bootstrapTone } from './bootstrap.js';
2
+ export { CHART_CATEGORICAL_COUNT, CHART_SEQUENTIAL_COUNT, chartColors } from './chartColors.js';
3
+ export { type ThemeContrastCheck, type ThemeReport, checkTheme } from './checkTheme.js';
4
+ export { type ColorDifferenceCheck, type ColorVisionDeficiency, checkColorDifferences, } from './colorVision.js';
5
+ export { type Rgb } from './color.js';
6
+ export { type ComponentTokens, defineComponentTokens } from './componentTokens.js';
7
+ export { type ComponentTokenName, componentTokens } from './components.js';
8
+ export { type PaletteTokenName, type PanneauTokens, type ThemeDefinition, type ThemeTokens, type TokenName, defineTheme, findUnknownTokens, mergeThemes, } from './defineTheme.js';
9
+ export { type ThemeFont, type ThemeFontFace, type ThemeFontStylesheet } from './fonts.js';
10
+ export { SEMANTIC_TOKENS, type SemanticTokenName } from './semanticTokens.js';
11
+ export { type ColorScheme, type Density, type Theme } from './theme.js';
12
+ export { BUILT_IN_TONES, type PanneauTones, type Tone, type ToneInput, type ToneSurfaces, type ToneValues, deriveTone, toneClassName, } from './tones.js';
13
13
  //# sourceMappingURL=index.d.ts.map
@@ -1,5 +1,5 @@
1
- import type { ThemeFont } from './fonts';
2
- import { type ToneInput, type ToneSurfaces } from './tones';
1
+ import type { ThemeFont } from './fonts.js';
2
+ import { type ToneInput, type ToneSurfaces } from './tones.js';
3
3
  /**
4
4
  * A theme: design tokens, as CSS variables without the leading `--`, with optional overrides for
5
5
  * the dark scheme, raw palette colors, its own tones, and named variants of components (decision
@@ -1,4 +1,4 @@
1
- import { type Tone } from './tones';
1
+ import { type Tone } from './tones.js';
2
2
  /**
3
3
  * The class of a tone, `panneau-tone-<tone>`. The built-in tones come from `Tone.module.css`, whose
4
4
  * classes get the same stable names, so using it includes their CSS; a theme's own tones get their
@@ -1,4 +1,4 @@
1
- import { type Rgb } from './color';
1
+ import { type Rgb } from './color.js';
2
2
  /**
3
3
  * The tones that components accept (`tone="success"`), like Bootstrap's `$theme-colors`. A theme
4
4
  * adds its own; declare them here so that `tone="signal"` type-checks:
@@ -1,5 +1,5 @@
1
1
  import { type TimeFieldProps, type TimeValue } from 'react-aria-components';
2
- import { type FieldChromeProps } from '../field/FieldParts';
2
+ import { type FieldChromeProps } from '../field/FieldParts.js';
3
3
  export interface TimeInputProps extends Omit<TimeFieldProps<TimeValue>, 'className' | 'style' | 'children' | 'isInvalid' | 'validate'>, FieldChromeProps {
4
4
  controlClassName?: string;
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import { type ReactNode } from 'react';
2
- import type { Tone } from '../theme/tones';
2
+ import type { Tone } from '../theme/tones.js';
3
3
  /** @deprecated Use `Tone`. */
4
4
  export type ToastTone = Tone;
5
5
  /** What a toast says. */
@@ -1,3 +1,3 @@
1
1
  /** Tokens of Toast. */
2
- export declare const toastTokens: import("..").ComponentTokens<"toast", "panneau-toast-width" | "panneau-toast-radius" | "panneau-toast-bg" | "panneau-toast-border-color" | "panneau-toast-shadow" | "panneau-toast-tone-width">;
2
+ export declare const toastTokens: import("../index.js").ComponentTokens<"toast", "panneau-toast-width" | "panneau-toast-radius" | "panneau-toast-bg" | "panneau-toast-border-color" | "panneau-toast-shadow" | "panneau-toast-tone-width">;
3
3
  //# sourceMappingURL=tokens.d.ts.map
@@ -1,3 +1,3 @@
1
1
  /** Tokens of Tooltip. */
2
- export declare const tooltipTokens: import("..").ComponentTokens<"tooltip", "panneau-tooltip-color" | "panneau-tooltip-radius" | "panneau-tooltip-padding-y" | "panneau-tooltip-padding-x" | "panneau-tooltip-font-size" | "panneau-tooltip-bg">;
2
+ export declare const tooltipTokens: import("../index.js").ComponentTokens<"tooltip", "panneau-tooltip-color" | "panneau-tooltip-radius" | "panneau-tooltip-padding-y" | "panneau-tooltip-padding-x" | "panneau-tooltip-font-size" | "panneau-tooltip-bg">;
3
3
  //# sourceMappingURL=tokens.d.ts.map
@@ -0,0 +1,4 @@
1
+ import type { SyntheticEvent } from 'react';
2
+ /** Stops an event from reaching the components around: for `onSubmit` of overlays. */
3
+ export declare function stopPropagation(event: SyntheticEvent): void;
4
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/utils/events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,sFAAsF;AACtF,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,CAE3D"}
@@ -0,0 +1,9 @@
1
+ //#region src/utils/events.ts
2
+ /** Stops an event from reaching the components around: for `onSubmit` of overlays. */
3
+ function stopPropagation(event) {
4
+ event.stopPropagation();
5
+ }
6
+ //#endregion
7
+ export { stopPropagation };
8
+
9
+ //# sourceMappingURL=events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.js","names":["SyntheticEvent","stopPropagation","event"],"sources":["../../src/utils/events.ts"],"sourcesContent":["import type { SyntheticEvent } from 'react';\n\n/** Stops an event from reaching the components around: for `onSubmit` of overlays. */\nexport function stopPropagation(event: SyntheticEvent): void {\n event.stopPropagation();\n}\n"],"mappings":";;AAGA,SAAgBC,gBAAgBC,OAA6B;CACzDA,MAAMD,gBAAgB;AAC1B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panneau/ui",
3
- "version": "5.0.0-alpha.7",
3
+ "version": "5.0.0-alpha.9",
4
4
  "description": "Design tokens, themes and accessible primitives of Panneau, built on React Aria Components.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -43,9 +43,9 @@
43
43
  "panneau-check-theme": "./bin/check-theme.js"
44
44
  },
45
45
  "scripts": {
46
- "build": "vite build && tsc -p tsconfig.build.json",
46
+ "build": "vite build && node ../../scripts/declarations.js",
47
47
  "typecheck": "tsc --noEmit",
48
- "api": "tsc -p tsconfig.build.json && node ../../scripts/api-report.js"
48
+ "api": "node ../../scripts/declarations.js && node ../../scripts/api-report.js"
49
49
  },
50
50
  "publishConfig": {
51
51
  "access": "public"
@@ -57,10 +57,10 @@
57
57
  "react-intl": "^12.0.0"
58
58
  },
59
59
  "dependencies": {
60
- "@panneau/intl": "5.0.0-alpha.7",
60
+ "@panneau/intl": "5.0.0-alpha.9",
61
61
  "lucide-react": "^1.57.0"
62
62
  },
63
63
  "devDependencies": {
64
- "@panneau/protocol": "5.0.0-alpha.7"
64
+ "@panneau/protocol": "5.0.0-alpha.9"
65
65
  }
66
66
  }