@gridui/preferences 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,10 +6,6 @@ Import components from `@gridui/preferences` and load these styles in order:
6
6
 
7
7
  ```css
8
8
  @import "@gridui/theme/styles.css";
9
- @import "@gridui/button/styles.css";
10
- @import "@gridui/overlay/styles.css";
11
- @import "@gridui/dropdown-menu/styles.css";
12
- @import "@gridui/tooltip/styles.css";
13
9
  @import "@gridui/preferences/styles.css";
14
10
  ```
15
11
 
@@ -19,6 +15,16 @@ labels, state persistence, and branding.
19
15
 
20
16
  See [component ownership](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/docs/component-ownership.md) and [release history](https://github.com/sudo-ui/GridUI-React-Monorepo/tree/main/packages-core/preferences/.changeset/history).
21
17
 
18
+ ## Styles
19
+
20
+ Load Theme once. Use `@gridui/preferences/styled` for automatic component CSS in
21
+ CSS-aware bundlers, or keep the CSS-free root import and load `@gridui/preferences/styles.css`.
22
+ Both entries expose the same root API. The standalone stylesheet includes component
23
+ dependency styles; Theme/reset remain separate. See the
24
+ [integration guide](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/docs/usage/integration.md)
25
+ for static HTML loading, SSR limits, and avoiding duplicate CSS.
26
+
27
+
22
28
  ## Preferences
23
29
 
24
30
  `PreferencesControls` is available from `@gridui/preferences` with dropdown
@@ -41,3 +47,13 @@ coordinates form state with data or page regions.
41
47
 
42
48
 
43
49
  [Component reference](docs/reference/README.md) contains focused API pages for each public component.
50
+
51
+ Language links use each item's `locale` as native `lang` and `hrefLang`. Optional
52
+ `dir` accepts `ltr`, `rtl`, or `auto` (default). Labels remain caller-provided;
53
+ GridUI does not translate or infer font assets from a locale.
54
+
55
+ ## Local color scopes
56
+
57
+ Pass `portalContainer` to PreferencesControls to mount its dropdowns and tooltips
58
+ inside a `data-gridui-system` region. The default remains the document body.
59
+ Inline content continues inheriting from its actual DOM parent.
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import { Tooltip, TooltipContent, TooltipTrigger } from "@gridui/tooltip";
5
5
  import { useState } from "react";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
  var PreferenceMenu = (props) => {
8
- const { label, icon, children, selectionAppearance } = props;
8
+ const { label, icon, children, selectionAppearance, container } = props;
9
9
  const [
10
10
  menuOpen,
11
11
  setMenuOpen
@@ -50,6 +50,7 @@ var PreferenceMenu = (props) => {
50
50
  /* @__PURE__ */ jsx(
51
51
  TooltipContent,
52
52
  {
53
+ container,
53
54
  align: "end",
54
55
  children: label
55
56
  }
@@ -60,6 +61,7 @@ var PreferenceMenu = (props) => {
60
61
  /* @__PURE__ */ jsx(
61
62
  DropdownMenuContent,
62
63
  {
64
+ container,
63
65
  selectionAppearance,
64
66
  children
65
67
  }
@@ -93,7 +95,7 @@ var preferencesOptionsStyles = cva(cn(
93
95
  ), {
94
96
  variants: {
95
97
  selectionAppearance: {
96
- filled: "gridui-u-preferences--*:aria-[current=page]:bg-brand-tint gridui-u-preferences--*:aria-pressed:bg-brand-tint",
98
+ filled: "gridui-u-preferences--*:aria-[current=page]:bg-selection-background gridui-u-preferences--*:aria-pressed:bg-selection-background",
97
99
  indicator: ""
98
100
  }
99
101
  },
@@ -111,7 +113,7 @@ import { TooltipProvider } from "@gridui/tooltip";
111
113
  import { Globe, Laptop, Moon, Sun } from "lucide-react";
112
114
  import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
113
115
  var DropdownPreferences = (props) => {
114
- const { labels, theme, onThemeChange, languageLinks, selectionAppearance } = props;
116
+ const { labels, theme, onThemeChange, languageLinks, selectionAppearance, portalContainer } = props;
115
117
  const themeIcons = {
116
118
  system: Laptop,
117
119
  dark: Moon,
@@ -126,6 +128,7 @@ var DropdownPreferences = (props) => {
126
128
  /* @__PURE__ */ jsxs2(
127
129
  PreferenceMenu,
128
130
  {
131
+ container: portalContainer,
129
132
  selectionAppearance,
130
133
  label: labels.language,
131
134
  icon: /* @__PURE__ */ jsx2(
@@ -152,6 +155,7 @@ var DropdownPreferences = (props) => {
152
155
  /* @__PURE__ */ jsxs2(
153
156
  PreferenceMenu,
154
157
  {
158
+ container: portalContainer,
155
159
  selectionAppearance,
156
160
  label: labels.appearance,
157
161
  icon: /* @__PURE__ */ jsx2(
@@ -312,6 +316,7 @@ var PreferencesControls = (props) => {
312
316
  href: language.href,
313
317
  hrefLang: language.locale,
314
318
  lang: language.locale,
319
+ dir: language.dir ?? "auto",
315
320
  "aria-current": language.current ? "page" : void 0,
316
321
  onClick: language.onSelect,
317
322
  children: [
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/preferences-controls/menu.tsx", "../src/preferences-controls/style.ts", "../src/preferences-controls/dropdown.tsx", "../src/preferences-controls/inline.tsx", "../src/preferences-controls/preferences-controls.tsx"],
4
- "sourcesContent": ["/**\n * @author WMXPY\n * @package Preferences\n * @namespace PreferencesControls\n * @description Menu\n */\n\nimport { Button } from \"@gridui/button\";\nimport { DropdownMenu, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuTrigger } from \"@gridui/dropdown-menu\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@gridui/tooltip\";\nimport { type FC, type ReactNode, useState } from \"react\";\n\nexport type PreferenceMenuProps = Pick<DropdownMenuContentProps, \"selectionAppearance\"> & {\n readonly label: string;\n readonly icon: ReactNode;\n readonly children: ReactNode;\n};\n\nexport const PreferenceMenu: FC<PreferenceMenuProps> = (props: PreferenceMenuProps) => {\n const { label, icon, children, selectionAppearance } = props;\n const [\n menuOpen,\n setMenuOpen,\n ] = useState(false);\n const [\n hintOpen,\n setHintOpen,\n ] = useState(false);\n return (<DropdownMenu\n open={menuOpen}\n onOpenChange={(open) => {\n setMenuOpen(open);\n if (open) {\n setHintOpen(false);\n }\n }}\n >\n <Tooltip\n open={hintOpen && !menuOpen}\n onOpenChange={setHintOpen}\n >\n <TooltipTrigger>\n <DropdownMenuTrigger\n asChild\n >\n <Button\n variant=\"quiet\"\n size=\"small\"\n layout=\"icon\"\n aria-label={label}\n >\n {icon}\n </Button>\n </DropdownMenuTrigger>\n </TooltipTrigger>\n <TooltipContent\n align=\"end\"\n >\n {label}\n </TooltipContent>\n </Tooltip>\n <DropdownMenuContent\n selectionAppearance={selectionAppearance}\n >\n {children}\n </DropdownMenuContent>\n </DropdownMenu>);\n};\n", "/**\n * @author WMXPY\n * @package Preferences\n * @namespace PreferencesControls\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const preferencesStyles = cva(cn(\n \"gridui-preferences\",\n \"gridui-u-preferences--flex gridui-u-preferences--flex-wrap gridui-u-preferences--gap-gridui-8\",\n));\n\nexport const preferencesInlineStyles = cva(cn(\n \"gridui-preferences-inline\",\n \"gridui-u-preferences--grid gridui-u-preferences--gap-gridui-24\",\n));\n\nexport const preferencesLabelStyles = cva(cn(\n \"gridui-preferences-label\",\n \"gridui-u-preferences--m-0 gridui-u-preferences--text-muted gridui-u-preferences--type-caption\",\n));\n\nexport const preferencesOptionsStyles = cva(cn(\n \"gridui-preferences-options\",\n \"gridui-u-preferences--flex gridui-u-preferences--flex-wrap gridui-u-preferences--items-stretch gridui-u-preferences--gap-px gridui-u-preferences--border gridui-u-preferences--border-solid gridui-u-preferences--border-border gridui-u-preferences--rounded-control gridui-u-preferences--bg-border\",\n \"gridui-u-preferences--*:flex-[1_1_auto] gridui-u-preferences--*:min-w-0 gridui-u-preferences--*:max-w-full gridui-u-preferences--*:rounded-none gridui-u-preferences--*:border-0 gridui-u-preferences--*:bg-background gridui-u-preferences--*:whitespace-normal gridui-u-preferences--*:wrap-anywhere\",\n \"gridui-u-preferences--[&_>_a]:inline-flex gridui-u-preferences--[&_>_a]:min-h-gridui-control-small gridui-u-preferences--[&_>_a]:items-center gridui-u-preferences--[&_>_a]:justify-center gridui-u-preferences--[&_>_a]:gap-gridui-4 gridui-u-preferences--[&_>_a]:py-gridui-4 gridui-u-preferences--[&_>_a]:px-gridui-8 gridui-u-preferences--[&_>_a]:text-foreground gridui-u-preferences--[&_>_a]:no-underline gridui-u-preferences--[&_>_a]:type-ui\",\n \"gridui-u-preferences--*:aria-[current=page]:text-foreground gridui-u-preferences--*:aria-pressed:text-foreground\",\n), {\n variants: {\n selectionAppearance: {\n filled: \"gridui-u-preferences--*:aria-[current=page]:bg-brand-tint gridui-u-preferences--*:aria-pressed:bg-brand-tint\",\n indicator: \"\",\n },\n },\n defaultVariants: {\n selectionAppearance: \"filled\",\n },\n});\n", "/**\n * @author WMXPY\n * @package Preferences\n * @namespace PreferencesControls\n * @description Dropdown\n */\n\nimport { PreferenceMenu } from \"./menu\";\nimport { preferencesStyles } from \"./style\";\nimport type { PreferencesViewOptions } from \"./types\";\nimport { DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem } from \"@gridui/dropdown-menu\";\nimport { cn } from \"@gridui/style-utils\";\nimport { isTheme } from \"@gridui/theme/preference\";\nimport { THEME } from \"@gridui/theme/theme\";\nimport { TooltipProvider } from \"@gridui/tooltip\";\nimport { Globe, Laptop, Moon, Sun } from \"lucide-react\";\nimport type { FC } from \"react\";\n\nexport type DropdownPreferencesProps = PreferencesViewOptions;\n\nexport const DropdownPreferences: FC<DropdownPreferencesProps> = (props: DropdownPreferencesProps) => {\n const { labels, theme, onThemeChange, languageLinks, selectionAppearance } = props;\n const themeIcons = {\n system: Laptop,\n dark: Moon,\n light: Sun,\n };\n const ThemeIcon = themeIcons[theme];\n return (<TooltipProvider>\n <div\n className={cn(preferencesStyles())}\n >\n <PreferenceMenu\n selectionAppearance={selectionAppearance}\n label={labels.language}\n icon={(<Globe\n aria-hidden=\"true\"\n />)}\n >\n <DropdownMenuLabel>\n {labels.language}\n </DropdownMenuLabel>\n {languageLinks.map((link) => {\n return (<DropdownMenuItem\n key={link.key}\n asChild\n >\n {link}\n </DropdownMenuItem>);\n })}\n </PreferenceMenu>\n <PreferenceMenu\n selectionAppearance={selectionAppearance}\n label={labels.appearance}\n icon={(<ThemeIcon\n aria-hidden=\"true\"\n />)}\n >\n <DropdownMenuLabel>\n {labels.appearance}\n </DropdownMenuLabel>\n <DropdownMenuRadioGroup\n value={theme}\n onValueChange={(value) => {\n if (isTheme(value)) {\n onThemeChange(value);\n }\n }}\n >\n <DropdownMenuRadioItem\n value={THEME.SYSTEM}\n >\n {labels.system}\n </DropdownMenuRadioItem>\n <DropdownMenuRadioItem\n value={THEME.LIGHT}\n >\n {labels.light}\n </DropdownMenuRadioItem>\n <DropdownMenuRadioItem\n value={THEME.DARK}\n >\n {labels.dark}\n </DropdownMenuRadioItem>\n </DropdownMenuRadioGroup>\n </PreferenceMenu>\n </div>\n </TooltipProvider>);\n};\n", "/**\n * @author WMXPY\n * @package Preferences\n * @namespace PreferencesControls\n * @description Inline\n */\n\nimport { preferencesInlineStyles, preferencesLabelStyles, preferencesOptionsStyles } from \"./style\";\nimport type { PreferencesViewOptions } from \"./types\";\nimport { Button } from \"@gridui/button\";\nimport { overlayListIndicatorStyles } from \"@gridui/overlay\";\nimport { cn } from \"@gridui/style-utils\";\nimport { THEME } from \"@gridui/theme/theme\";\nimport { Check } from \"lucide-react\";\nimport type { FC } from \"react\";\n\nexport type InlinePreferencesProps = PreferencesViewOptions;\n\nexport const InlinePreferences: FC<InlinePreferencesProps> = (props: InlinePreferencesProps) => {\n const { labels, theme, onThemeChange, languageLinks, selectionAppearance } = props;\n return (<div\n className={cn(preferencesInlineStyles())}\n >\n <div\n role=\"group\"\n aria-label={labels.language}\n >\n <p\n className={cn(preferencesLabelStyles())}\n >\n {labels.language}\n </p>\n <div\n className={cn(preferencesOptionsStyles({ selectionAppearance }))}\n >\n {languageLinks}\n </div>\n </div>\n <div\n role=\"group\"\n aria-label={labels.appearance}\n >\n <p\n className={cn(preferencesLabelStyles())}\n >\n {labels.appearance}\n </p>\n <div\n className={cn(preferencesOptionsStyles({ selectionAppearance }))}\n >\n {([\n THEME.SYSTEM,\n THEME.LIGHT,\n THEME.DARK,\n ] as const).map((value) => {\n return (<Button\n key={value}\n size=\"small\"\n variant=\"quiet\"\n aria-pressed={theme === value}\n endIcon={(<span\n className={overlayListIndicatorStyles()}\n >\n {theme === value ? (<Check\n size={16}\n />) : null}\n </span>)}\n onClick={() => {\n return void onThemeChange(value);\n }}\n >\n {labels[value]}\n </Button>);\n })}\n </div>\n </div>\n </div>);\n};\n", "/**\n * @author WMXPY\n * @package Preferences\n * @namespace PreferencesControls\n * @description Preferences Controls\n */\n\nimport { DropdownPreferences } from \"./dropdown\";\nimport { InlinePreferences } from \"./inline\";\nimport type { PreferenceLanguage } from \"./language\";\nimport type { PreferencesOptions } from \"./types\";\nimport { overlayListIndicatorStyles } from \"@gridui/overlay\";\nimport { Check } from \"lucide-react\";\nimport type { FC } from \"react\";\n\nexport type PreferencesControlsProps = PreferencesOptions & {\n readonly presentation?: \"dropdown\" | \"inline\";\n readonly languages: readonly PreferenceLanguage[];\n};\n\nexport const PreferencesControls: FC<PreferencesControlsProps> = (props: PreferencesControlsProps) => {\n const { presentation = \"dropdown\", languages, ...options } = props;\n const languageLinks = languages.map((language) => {\n return (<a\n key={language.locale}\n href={language.href}\n hrefLang={language.locale}\n lang={language.locale}\n aria-current={language.current ? \"page\" : undefined}\n onClick={language.onSelect}\n >\n <span\n className=\"gridui-u-preferences--min-w-0 gridui-u-preferences--flex-1\"\n >\n {language.label}\n </span>\n <span\n className={overlayListIndicatorStyles()}\n aria-hidden=\"true\"\n >\n {language.current ? (<Check\n size={16}\n />) : null}\n </span>\n </a>);\n });\n\n if (presentation === \"inline\") {\n return (<InlinePreferences\n {...options}\n languageLinks={languageLinks}\n />);\n }\n return (<DropdownPreferences\n {...options}\n languageLinks={languageLinks}\n />);\n};\n"],
5
- "mappings": ";AAOA,SAAS,cAAc;AACvB,SAAS,cAAc,qBAAoD,2BAA2B;AACtG,SAAS,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BAAgB,UAAU,IAAI,CAAC,aAAa;AAC9C,WAAQ,gBAAAA;AAAA,MAAC;AAAA;AAAA,QAEL,MAAM,SAAS;AAAA,QACf,UAAU,SAAS;AAAA,QACnB,MAAM,SAAS;AAAA,QACf,gBAAc,SAAS,UAAU,SAAS;AAAA,QAC1C,SAAS,SAAS;AAAA,QAElB;AAAA,0BAAAD;AAAA,YAAC;AAAA;AAAA,cACG,WAAU;AAAA,cAET,mBAAS;AAAA;AAAA,UACd;AAAA,UACA,gBAAAA;AAAA,YAAC;AAAA;AAAA,cACG,WAAWF,4BAA2B;AAAA,cACtC,eAAY;AAAA,cAEX,mBAAS,UAAW,gBAAAE;AAAA,gBAACD;AAAA,gBAAA;AAAA,kBAClB,MAAM;AAAA;AAAA,cACV,IAAM;AAAA;AAAA,UACV;AAAA;AAAA;AAAA,MAnBK,SAAS;AAAA,IAoBlB;AAAA,EACJ,CAAC;AAED,MAAI,iBAAiB,UAAU;AAC3B,WAAQ,gBAAAC;AAAA,MAAC;AAAA;AAAA,QACJ,GAAG;AAAA,QACJ;AAAA;AAAA,IACJ;AAAA,EACJ;AACA,SAAQ,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACJ,GAAG;AAAA,MACJ;AAAA;AAAA,EACJ;AACJ;",
4
+ "sourcesContent": ["/**\n * @author WMXPY\n * @package Preferences\n * @namespace PreferencesControls\n * @description Menu\n */\n\nimport { Button } from \"@gridui/button\";\nimport { DropdownMenu, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuTrigger } from \"@gridui/dropdown-menu\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@gridui/tooltip\";\nimport { type FC, type ReactNode, useState } from \"react\";\n\nexport type PreferenceMenuProps = Pick<DropdownMenuContentProps, \"selectionAppearance\" | \"container\"> & {\n readonly label: string;\n readonly icon: ReactNode;\n readonly children: ReactNode;\n};\n\nexport const PreferenceMenu: FC<PreferenceMenuProps> = (props: PreferenceMenuProps) => {\n const { label, icon, children, selectionAppearance, container } = props;\n const [\n menuOpen,\n setMenuOpen,\n ] = useState(false);\n const [\n hintOpen,\n setHintOpen,\n ] = useState(false);\n return (<DropdownMenu\n open={menuOpen}\n onOpenChange={(open) => {\n setMenuOpen(open);\n if (open) {\n setHintOpen(false);\n }\n }}\n >\n <Tooltip\n open={hintOpen && !menuOpen}\n onOpenChange={setHintOpen}\n >\n <TooltipTrigger>\n <DropdownMenuTrigger\n asChild\n >\n <Button\n variant=\"quiet\"\n size=\"small\"\n layout=\"icon\"\n aria-label={label}\n >\n {icon}\n </Button>\n </DropdownMenuTrigger>\n </TooltipTrigger>\n <TooltipContent\n container={container}\n align=\"end\"\n >\n {label}\n </TooltipContent>\n </Tooltip>\n <DropdownMenuContent\n container={container}\n selectionAppearance={selectionAppearance}\n >\n {children}\n </DropdownMenuContent>\n </DropdownMenu>);\n};\n", "/**\n * @author WMXPY\n * @package Preferences\n * @namespace PreferencesControls\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const preferencesStyles = cva(cn(\n \"gridui-preferences\",\n \"gridui-u-preferences--flex gridui-u-preferences--flex-wrap gridui-u-preferences--gap-gridui-8\",\n));\n\nexport const preferencesInlineStyles = cva(cn(\n \"gridui-preferences-inline\",\n \"gridui-u-preferences--grid gridui-u-preferences--gap-gridui-24\",\n));\n\nexport const preferencesLabelStyles = cva(cn(\n \"gridui-preferences-label\",\n \"gridui-u-preferences--m-0 gridui-u-preferences--text-muted gridui-u-preferences--type-caption\",\n));\n\nexport const preferencesOptionsStyles = cva(cn(\n \"gridui-preferences-options\",\n \"gridui-u-preferences--flex gridui-u-preferences--flex-wrap gridui-u-preferences--items-stretch gridui-u-preferences--gap-px gridui-u-preferences--border gridui-u-preferences--border-solid gridui-u-preferences--border-border gridui-u-preferences--rounded-control gridui-u-preferences--bg-border\",\n \"gridui-u-preferences--*:flex-[1_1_auto] gridui-u-preferences--*:min-w-0 gridui-u-preferences--*:max-w-full gridui-u-preferences--*:rounded-none gridui-u-preferences--*:border-0 gridui-u-preferences--*:bg-background gridui-u-preferences--*:whitespace-normal gridui-u-preferences--*:wrap-anywhere\",\n \"gridui-u-preferences--[&_>_a]:inline-flex gridui-u-preferences--[&_>_a]:min-h-gridui-control-small gridui-u-preferences--[&_>_a]:items-center gridui-u-preferences--[&_>_a]:justify-center gridui-u-preferences--[&_>_a]:gap-gridui-4 gridui-u-preferences--[&_>_a]:py-gridui-4 gridui-u-preferences--[&_>_a]:px-gridui-8 gridui-u-preferences--[&_>_a]:text-foreground gridui-u-preferences--[&_>_a]:no-underline gridui-u-preferences--[&_>_a]:type-ui\",\n \"gridui-u-preferences--*:aria-[current=page]:text-foreground gridui-u-preferences--*:aria-pressed:text-foreground\",\n), {\n variants: {\n selectionAppearance: {\n filled: \"gridui-u-preferences--*:aria-[current=page]:bg-selection-background gridui-u-preferences--*:aria-pressed:bg-selection-background\",\n indicator: \"\",\n },\n },\n defaultVariants: {\n selectionAppearance: \"filled\",\n },\n});\n", "/**\n * @author WMXPY\n * @package Preferences\n * @namespace PreferencesControls\n * @description Dropdown\n */\n\nimport { PreferenceMenu } from \"./menu\";\nimport { preferencesStyles } from \"./style\";\nimport type { PreferencesViewOptions } from \"./types\";\nimport { DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem } from \"@gridui/dropdown-menu\";\nimport { cn } from \"@gridui/style-utils\";\nimport { isTheme } from \"@gridui/theme/preference\";\nimport { THEME } from \"@gridui/theme/theme\";\nimport { TooltipProvider } from \"@gridui/tooltip\";\nimport { Globe, Laptop, Moon, Sun } from \"lucide-react\";\nimport type { FC } from \"react\";\n\nexport type DropdownPreferencesProps = PreferencesViewOptions;\n\nexport const DropdownPreferences: FC<DropdownPreferencesProps> = (props: DropdownPreferencesProps) => {\n const { labels, theme, onThemeChange, languageLinks, selectionAppearance, portalContainer } = props;\n const themeIcons = {\n system: Laptop,\n dark: Moon,\n light: Sun,\n };\n const ThemeIcon = themeIcons[theme];\n return (<TooltipProvider>\n <div\n className={cn(preferencesStyles())}\n >\n <PreferenceMenu\n container={portalContainer}\n selectionAppearance={selectionAppearance}\n label={labels.language}\n icon={(<Globe\n aria-hidden=\"true\"\n />)}\n >\n <DropdownMenuLabel>\n {labels.language}\n </DropdownMenuLabel>\n {languageLinks.map((link) => {\n return (<DropdownMenuItem\n key={link.key}\n asChild\n >\n {link}\n </DropdownMenuItem>);\n })}\n </PreferenceMenu>\n <PreferenceMenu\n container={portalContainer}\n selectionAppearance={selectionAppearance}\n label={labels.appearance}\n icon={(<ThemeIcon\n aria-hidden=\"true\"\n />)}\n >\n <DropdownMenuLabel>\n {labels.appearance}\n </DropdownMenuLabel>\n <DropdownMenuRadioGroup\n value={theme}\n onValueChange={(value) => {\n if (isTheme(value)) {\n onThemeChange(value);\n }\n }}\n >\n <DropdownMenuRadioItem\n value={THEME.SYSTEM}\n >\n {labels.system}\n </DropdownMenuRadioItem>\n <DropdownMenuRadioItem\n value={THEME.LIGHT}\n >\n {labels.light}\n </DropdownMenuRadioItem>\n <DropdownMenuRadioItem\n value={THEME.DARK}\n >\n {labels.dark}\n </DropdownMenuRadioItem>\n </DropdownMenuRadioGroup>\n </PreferenceMenu>\n </div>\n </TooltipProvider>);\n};\n", "/**\n * @author WMXPY\n * @package Preferences\n * @namespace PreferencesControls\n * @description Inline\n */\n\nimport { preferencesInlineStyles, preferencesLabelStyles, preferencesOptionsStyles } from \"./style\";\nimport type { PreferencesViewOptions } from \"./types\";\nimport { Button } from \"@gridui/button\";\nimport { overlayListIndicatorStyles } from \"@gridui/overlay\";\nimport { cn } from \"@gridui/style-utils\";\nimport { THEME } from \"@gridui/theme/theme\";\nimport { Check } from \"lucide-react\";\nimport type { FC } from \"react\";\n\nexport type InlinePreferencesProps = PreferencesViewOptions;\n\nexport const InlinePreferences: FC<InlinePreferencesProps> = (props: InlinePreferencesProps) => {\n const { labels, theme, onThemeChange, languageLinks, selectionAppearance } = props;\n return (<div\n className={cn(preferencesInlineStyles())}\n >\n <div\n role=\"group\"\n aria-label={labels.language}\n >\n <p\n className={cn(preferencesLabelStyles())}\n >\n {labels.language}\n </p>\n <div\n className={cn(preferencesOptionsStyles({ selectionAppearance }))}\n >\n {languageLinks}\n </div>\n </div>\n <div\n role=\"group\"\n aria-label={labels.appearance}\n >\n <p\n className={cn(preferencesLabelStyles())}\n >\n {labels.appearance}\n </p>\n <div\n className={cn(preferencesOptionsStyles({ selectionAppearance }))}\n >\n {([\n THEME.SYSTEM,\n THEME.LIGHT,\n THEME.DARK,\n ] as const).map((value) => {\n return (<Button\n key={value}\n size=\"small\"\n variant=\"quiet\"\n aria-pressed={theme === value}\n endIcon={(<span\n className={overlayListIndicatorStyles()}\n >\n {theme === value ? (<Check\n size={16}\n />) : null}\n </span>)}\n onClick={() => {\n return void onThemeChange(value);\n }}\n >\n {labels[value]}\n </Button>);\n })}\n </div>\n </div>\n </div>);\n};\n", "/**\n * @author WMXPY\n * @package Preferences\n * @namespace PreferencesControls\n * @description Preferences Controls\n */\n\nimport { DropdownPreferences } from \"./dropdown\";\nimport { InlinePreferences } from \"./inline\";\nimport type { PreferenceLanguage } from \"./language\";\nimport type { PreferencesOptions } from \"./types\";\nimport { overlayListIndicatorStyles } from \"@gridui/overlay\";\nimport { Check } from \"lucide-react\";\nimport type { FC } from \"react\";\n\nexport type PreferencesControlsProps = PreferencesOptions & {\n readonly presentation?: \"dropdown\" | \"inline\";\n readonly languages: readonly PreferenceLanguage[];\n};\n\nexport const PreferencesControls: FC<PreferencesControlsProps> = (props: PreferencesControlsProps) => {\n const { presentation = \"dropdown\", languages, ...options } = props;\n const languageLinks = languages.map((language) => {\n return (<a\n key={language.locale}\n href={language.href}\n hrefLang={language.locale}\n lang={language.locale}\n dir={language.dir ?? \"auto\"}\n aria-current={language.current ? \"page\" : undefined}\n onClick={language.onSelect}\n >\n <span\n className=\"gridui-u-preferences--min-w-0 gridui-u-preferences--flex-1\"\n >\n {language.label}\n </span>\n <span\n className={overlayListIndicatorStyles()}\n aria-hidden=\"true\"\n >\n {language.current ? (<Check\n size={16}\n />) : null}\n </span>\n </a>);\n });\n\n if (presentation === \"inline\") {\n return (<InlinePreferences\n {...options}\n languageLinks={languageLinks}\n />);\n }\n return (<DropdownPreferences\n {...options}\n languageLinks={languageLinks}\n />);\n};\n"],
5
+ "mappings": ";AAOA,SAAS,cAAc;AACvB,SAAS,cAAc,qBAAoD,2BAA2B;AACtG,SAAS,SAAS,gBAAgB,sBAAsB;AACxD,SAAkC,gBAAgB;AA2B1C,SAQY,KARZ;AAnBD,IAAM,iBAA0C,CAAC,UAA+B;AACnF,QAAM,EAAE,OAAO,MAAM,UAAU,qBAAqB,UAAU,IAAI;AAClE,QAAM;AAAA,IACF;AAAA,IACA;AAAA,EACJ,IAAI,SAAS,KAAK;AAClB,QAAM;AAAA,IACF;AAAA,IACA;AAAA,EACJ,IAAI,SAAS,KAAK;AAClB,SAAQ;AAAA,IAAC;AAAA;AAAA,MACL,MAAM;AAAA,MACN,cAAc,CAAC,SAAS;AACpB,oBAAY,IAAI;AAChB,YAAI,MAAM;AACN,sBAAY,KAAK;AAAA,QACrB;AAAA,MACJ;AAAA,MAEA;AAAA;AAAA,UAAC;AAAA;AAAA,YACG,MAAM,YAAY,CAAC;AAAA,YACnB,cAAc;AAAA,YAEd;AAAA,kCAAC,kBACG;AAAA,gBAAC;AAAA;AAAA,kBACG,SAAO;AAAA,kBAEP;AAAA,oBAAC;AAAA;AAAA,sBACG,SAAQ;AAAA,sBACR,MAAK;AAAA,sBACL,QAAO;AAAA,sBACP,cAAY;AAAA,sBAEX;AAAA;AAAA,kBACL;AAAA;AAAA,cACJ,GACJ;AAAA,cACA;AAAA,gBAAC;AAAA;AAAA,kBACG;AAAA,kBACA,OAAM;AAAA,kBAEL;AAAA;AAAA,cACL;AAAA;AAAA;AAAA,QACJ;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACG;AAAA,YACA;AAAA,YAEC;AAAA;AAAA,QACL;AA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IndicatorStyles", "Check", "jsx", "jsxs"]
7
7
  }
@@ -6,6 +6,7 @@
6
6
  */
7
7
  export type PreferenceLanguage = {
8
8
  readonly locale: string;
9
+ readonly dir?: "ltr" | "rtl" | "auto";
9
10
  readonly label: string;
10
11
  readonly href: string;
11
12
  readonly current: boolean;
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import { type DropdownMenuContentProps } from "@gridui/dropdown-menu";
8
8
  import { type FC, type ReactNode } from "react";
9
- export type PreferenceMenuProps = Pick<DropdownMenuContentProps, "selectionAppearance"> & {
9
+ export type PreferenceMenuProps = Pick<DropdownMenuContentProps, "selectionAppearance" | "container"> & {
10
10
  readonly label: string;
11
11
  readonly icon: ReactNode;
12
12
  readonly children: ReactNode;
@@ -15,6 +15,7 @@ export type PreferenceLabels = {
15
15
  readonly dark: string;
16
16
  };
17
17
  export type PreferencesOptions = {
18
+ readonly portalContainer?: DropdownMenuContentProps["container"];
18
19
  /** Selection presentation for language and theme options in both dropdown and inline layouts. */
19
20
  readonly selectionAppearance?: DropdownMenuContentProps["selectionAppearance"];
20
21
  readonly labels: PreferenceLabels;
package/dist/styled.js ADDED
@@ -0,0 +1,6 @@
1
+ import "@gridui/button/styled";
2
+ import "@gridui/overlay/styled";
3
+ import "@gridui/dropdown-menu/styled";
4
+ import "@gridui/tooltip/styled";
5
+ import "./styles.local.css";
6
+ export * from "./index.js";
package/dist/styles.css CHANGED
@@ -1,3 +1,697 @@
1
+ /*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
2
+ @layer properties;
3
+ @layer theme, base, components, utilities;
4
+ @layer theme {
5
+ :root, :host {
6
+ --spacing: 0.25rem;
7
+ }
8
+ }
9
+ @layer utilities {
10
+ .gridui-u-button--pointer-events-none {
11
+ pointer-events: none;
12
+ }
13
+ .gridui-u-button--inline-flex {
14
+ display: inline-flex;
15
+ }
16
+ .gridui-u-button--h-full {
17
+ height: 100%;
18
+ }
19
+ .gridui-u-button--h-gridui-control {
20
+ height: var(--gridui-control-min-height);
21
+ }
22
+ .gridui-u-button--min-h-18 {
23
+ min-height: calc(var(--spacing) * 18);
24
+ }
25
+ .gridui-u-button--min-h-gridui-control {
26
+ min-height: var(--gridui-control-min-height);
27
+ }
28
+ .gridui-u-button--min-h-gridui-control-large {
29
+ min-height: var(--gridui-control-min-height-large);
30
+ }
31
+ .gridui-u-button--min-h-gridui-control-small {
32
+ min-height: var(--gridui-control-min-height-small);
33
+ }
34
+ .gridui-u-button--w-fit {
35
+ width: fit-content;
36
+ }
37
+ .gridui-u-button--w-full {
38
+ width: 100%;
39
+ }
40
+ .gridui-u-button--w-gridui-64 {
41
+ width: var(--gridui-space-64);
42
+ }
43
+ .gridui-u-button--w-gridui-control {
44
+ width: var(--gridui-control-min-height);
45
+ }
46
+ .gridui-u-button--w-gridui-control-large {
47
+ width: var(--gridui-control-min-height-large);
48
+ }
49
+ .gridui-u-button--w-gridui-control-small {
50
+ width: var(--gridui-control-min-height-small);
51
+ }
52
+ .gridui-u-button--max-w-full {
53
+ max-width: 100%;
54
+ }
55
+ .gridui-u-button--min-w-0 {
56
+ min-width: 0px;
57
+ }
58
+ .gridui-u-button--min-w-gridui-24 {
59
+ min-width: var(--gridui-space-24);
60
+ }
61
+ .gridui-u-button--flex-1 {
62
+ flex: 1;
63
+ }
64
+ .gridui-u-button--shrink-0 {
65
+ flex-shrink: 0;
66
+ }
67
+ .gridui-u-button--cursor-pointer {
68
+ cursor: pointer;
69
+ }
70
+ .gridui-u-button--flex-col {
71
+ flex-direction: column;
72
+ }
73
+ .gridui-u-button--items-center {
74
+ align-items: center;
75
+ }
76
+ .gridui-u-button--items-stretch {
77
+ align-items: stretch;
78
+ }
79
+ .gridui-u-button--justify-between {
80
+ justify-content: space-between;
81
+ }
82
+ .gridui-u-button--justify-center {
83
+ justify-content: center;
84
+ }
85
+ .gridui-u-button--justify-start {
86
+ justify-content: flex-start;
87
+ }
88
+ .gridui-u-button--gap-0 {
89
+ gap: 0px;
90
+ }
91
+ .gridui-u-button--gap-gridui-8 {
92
+ gap: var(--gridui-space-8);
93
+ }
94
+ .gridui-u-button--gap-gridui-32 {
95
+ gap: var(--gridui-space-32);
96
+ }
97
+ .gridui-u-button--self-stretch {
98
+ align-self: stretch;
99
+ }
100
+ .gridui-u-button--rounded-control {
101
+ border-radius: var(--gridui-control-radius);
102
+ }
103
+ .gridui-u-button--rounded-none {
104
+ border-radius: 0;
105
+ }
106
+ .gridui-u-button--border-0 {
107
+ border-style: var(--tw-border-style);
108
+ border-width: 0px;
109
+ }
110
+ .gridui-u-button--border-b {
111
+ border-bottom-style: var(--tw-border-style);
112
+ border-bottom-width: 1px;
113
+ }
114
+ .gridui-u-button--border-accent-background {
115
+ border-color: var(--gridui-accent-background);
116
+ }
117
+ .gridui-u-button--border-control-border {
118
+ border-color: var(--gridui-control-border);
119
+ }
120
+ .gridui-u-button--border-foreground {
121
+ border-color: var(--gridui-foreground);
122
+ }
123
+ .gridui-u-button--bg-accent-background {
124
+ background-color: var(--gridui-accent-background);
125
+ }
126
+ .gridui-u-button--bg-selection-background {
127
+ background-color: var(--gridui-selection-background);
128
+ }
129
+ .gridui-u-button--bg-transparent {
130
+ background-color: transparent;
131
+ }
132
+ .gridui-u-button--p-0 {
133
+ padding: 0px;
134
+ }
135
+ .gridui-u-button--px-0 {
136
+ padding-inline: 0px;
137
+ }
138
+ .gridui-u-button--px-gridui-8 {
139
+ padding-inline: var(--gridui-space-8);
140
+ }
141
+ .gridui-u-button--px-gridui-16 {
142
+ padding-inline: var(--gridui-space-16);
143
+ }
144
+ .gridui-u-button--px-gridui-24 {
145
+ padding-inline: var(--gridui-space-24);
146
+ }
147
+ .gridui-u-button--py-gridui-4 {
148
+ padding-block: var(--gridui-space-4);
149
+ }
150
+ .gridui-u-button--py-gridui-8 {
151
+ padding-block: var(--gridui-space-8);
152
+ }
153
+ .gridui-u-button--py-gridui-16 {
154
+ padding-block: var(--gridui-space-16);
155
+ }
156
+ .gridui-u-button--text-center {
157
+ text-align: center;
158
+ }
159
+ .gridui-u-button--text-left {
160
+ text-align: left;
161
+ }
162
+ .gridui-u-button--text-start {
163
+ text-align: start;
164
+ }
165
+ .gridui-u-button--type-supporting {
166
+ font: var(--gridui-type-supporting);
167
+ font-family: var(--gridui-font-body);
168
+ letter-spacing: normal;
169
+ }
170
+ .gridui-u-button--type-ui {
171
+ font: var(--gridui-type-ui);
172
+ font-family: var(--gridui-font-body);
173
+ letter-spacing: normal;
174
+ }
175
+ .gridui-u-button--wrap-anywhere {
176
+ overflow-wrap: anywhere;
177
+ }
178
+ .gridui-u-button--text-accent-foreground {
179
+ color: var(--gridui-accent-foreground);
180
+ }
181
+ .gridui-u-button--text-foreground {
182
+ color: var(--gridui-foreground);
183
+ }
184
+ .gridui-u-button--no-underline {
185
+ text-decoration-line: none;
186
+ }
187
+ .gridui-u-button--\[transition-property\:var\(--gridui-motion-transition\,color\,background-color\,border-color\,text-decoration-color\,fill\,stroke\)\] {
188
+ transition-property: var(--gridui-motion-transition,color,background-color,border-color,text-decoration-color,fill,stroke);
189
+ }
190
+ .gridui-u-button--duration-\[calc\(var\(--gridui-motion-duration-quick\)\*var\(--gridui-motion-factor\,1\)\)\] {
191
+ --tw-duration: calc(var(--gridui-motion-duration-quick) * var(--gridui-motion-factor,1));
192
+ transition-duration: calc(var(--gridui-motion-duration-quick) * var(--gridui-motion-factor,1));
193
+ }
194
+ .gridui-u-button--ease-\(--gridui-motion-ease-out\) {
195
+ --tw-ease: var(--gridui-motion-ease-out);
196
+ transition-timing-function: var(--gridui-motion-ease-out);
197
+ }
198
+ .gridui-u-button--\[--gridui-button-icon-size\:var\(--gridui-icon-size\)\] {
199
+ --gridui-button-icon-size: var(--gridui-icon-size);
200
+ }
201
+ .gridui-u-button--\[--gridui-button-icon-size\:var\(--gridui-icon-size-large\)\] {
202
+ --gridui-button-icon-size: var(--gridui-icon-size-large);
203
+ }
204
+ .gridui-u-button--\[--gridui-button-icon-size\:var\(--gridui-space-32\)\] {
205
+ --gridui-button-icon-size: var(--gridui-space-32);
206
+ }
207
+ .gridui-u-button--\[--gridui-button-icon-size\:var\(--gridui-space-48\)\] {
208
+ --gridui-button-icon-size: var(--gridui-space-48);
209
+ }
210
+ @media (hover: hover) {
211
+ .gridui-u-button--not-disabled\:not-aria-disabled\:not-data-disabled\:hover\:bg-accent-hover:not(:disabled):not([aria-disabled="true"]):not([data-disabled]):hover {
212
+ background-color: var(--gridui-accent-hover);
213
+ }
214
+ }
215
+ .gridui-u-button--not-disabled\:not-aria-disabled\:not-data-disabled\:active\:bg-accent-pressed:not(:disabled):not([aria-disabled="true"]):not([data-disabled]):active {
216
+ background-color: var(--gridui-accent-pressed);
217
+ }
218
+ .gridui-u-button--not-disabled\:not-aria-disabled\:not-data-disabled\:active\:bg-surface-pressed:not(:disabled):not([aria-disabled="true"]):not([data-disabled]):active {
219
+ background-color: var(--gridui-surface-pressed);
220
+ }
221
+ .gridui-u-button--disabled\:cursor-not-allowed:disabled {
222
+ cursor: not-allowed;
223
+ }
224
+ .gridui-u-button--aria-disabled\:cursor-not-allowed[aria-disabled="true"] {
225
+ cursor: not-allowed;
226
+ }
227
+ .gridui-u-button--data-disabled\:cursor-not-allowed[data-disabled] {
228
+ cursor: not-allowed;
229
+ }
230
+ .gridui-u-button--data-gridui-busy\:cursor-wait[data-gridui-busy] {
231
+ cursor: wait;
232
+ }
233
+ @media (prefers-reduced-motion: reduce) {
234
+ .gridui-u-button--motion-reduce\:transition-none {
235
+ transition-property: none;
236
+ }
237
+ }
238
+ .gridui-u-button--\[\&_\>_span\]\:whitespace-nowrap > span {
239
+ white-space: nowrap;
240
+ }
241
+ .gridui-u-button--\[\&_\>_span\]\:\[writing-mode\:vertical-rl\] > span {
242
+ writing-mode: vertical-rl;
243
+ }
244
+ .gridui-u-button--\[\&_svg\]\:pointer-events-none svg {
245
+ pointer-events: none;
246
+ }
247
+ .gridui-u-button--\[\&_svg\]\:h-\(--gridui-button-icon-size\) svg {
248
+ height: var(--gridui-button-icon-size);
249
+ }
250
+ .gridui-u-button--\[\&_svg\]\:w-\(--gridui-button-icon-size\) svg {
251
+ width: var(--gridui-button-icon-size);
252
+ }
253
+ .gridui-u-button--\[\&_svg\]\:shrink-0 svg {
254
+ flex-shrink: 0;
255
+ }
256
+ .gridui-u-button--\[\&\.gridui-button-extra-large\]\:h-18.gridui-button-extra-large {
257
+ height: calc(var(--spacing) * 18);
258
+ }
259
+ .gridui-u-button--\[\&\.gridui-button-extra-large\]\:w-18.gridui-button-extra-large {
260
+ width: calc(var(--spacing) * 18);
261
+ }
262
+ .gridui-u-button--\[\&\.gridui-button-large\]\:h-gridui-control-large.gridui-button-large {
263
+ height: var(--gridui-control-min-height-large);
264
+ }
265
+ .gridui-u-button--\[\&\.gridui-button-large\]\:w-gridui-control-large.gridui-button-large {
266
+ width: var(--gridui-control-min-height-large);
267
+ }
268
+ .gridui-u-button--\[\&\.gridui-button-small\]\:h-gridui-control-small.gridui-button-small {
269
+ height: var(--gridui-control-min-height-small);
270
+ }
271
+ .gridui-u-button--\[\&\.gridui-button-small\]\:w-gridui-control-small.gridui-button-small {
272
+ width: var(--gridui-control-min-height-small);
273
+ }
274
+ @media (pointer: coarse) {
275
+ .gridui-u-button--pointer-coarse\:\[\&\.gridui-button-small\]\:h-gridui-control.gridui-button-small {
276
+ height: var(--gridui-control-min-height);
277
+ }
278
+ .gridui-u-button--pointer-coarse\:\[\&\.gridui-button-small\]\:w-gridui-control.gridui-button-small {
279
+ width: var(--gridui-control-min-height);
280
+ }
281
+ }
282
+ }
283
+ @layer components {
284
+ .gridui-button {
285
+ border: 1px solid transparent;
286
+ }
287
+ .gridui-button-cell {
288
+ border: 0;
289
+ }
290
+ .gridui-button-label-content {
291
+ display: inline-flex;
292
+ min-width: 0;
293
+ flex-direction: inherit;
294
+ align-items: inherit;
295
+ justify-content: inherit;
296
+ gap: inherit;
297
+ }
298
+ .gridui-button-body {
299
+ display: inline-flex;
300
+ flex: 1;
301
+ min-width: 0;
302
+ flex-direction: inherit;
303
+ align-items: inherit;
304
+ justify-content: inherit;
305
+ gap: inherit;
306
+ }
307
+ .gridui-button:is(:disabled, [aria-disabled="true"]:not([data-gridui-busy]), [data-disabled]) > .gridui-button-content, .gridui-button:is(:disabled, [aria-disabled="true"]:not([data-gridui-busy]), [data-disabled]) > .gridui-button-start-region > .gridui-button-content, .gridui-button:is(:disabled, [aria-disabled="true"]:not([data-gridui-busy]), [data-disabled]) > .gridui-button-end-region > .gridui-button-content {
308
+ opacity: 0.5;
309
+ }
310
+ .gridui-button-start-region {
311
+ min-width: calc(var(--gridui-button-icon-size) + var(--gridui-space-16));
312
+ border-inline-end: 1px solid;
313
+ border-color: inherit;
314
+ }
315
+ .gridui-button-end-region {
316
+ border-inline-start: 1px solid;
317
+ border-color: inherit;
318
+ }
319
+ @media (prefers-reduced-motion: no-preference) {
320
+ .gridui-button-icon-motion-outward:not(:disabled, [aria-disabled="true"]:not([data-gridui-busy]), [data-disabled], [aria-readonly="true"], [data-readonly], [readonly]) .gridui-button-end-icon {
321
+ transition: var(--gridui-motion-transition, transform calc(var(--gridui-motion-duration-quick) * var(--gridui-motion-factor, 1)) var(--gridui-motion-ease-out));
322
+ }
323
+ .gridui-button-icon-motion-outward:not(:disabled, [aria-disabled="true"]:not([data-gridui-busy]), [data-disabled], [aria-readonly="true"], [data-readonly], [readonly]):hover .gridui-button-end-icon {
324
+ transform: var(--gridui-motion-transform, translate(var(--gridui-space-4), calc(-1 * var(--gridui-space-4))));
325
+ }
326
+ .gridui-button-icon-motion-outward:not(:disabled, [aria-disabled="true"]:not([data-gridui-busy]), [data-disabled], [aria-readonly="true"], [data-readonly], [readonly]):dir(rtl):hover .gridui-button-end-icon {
327
+ transform: var(--gridui-motion-transform, translate(calc(-1 * var(--gridui-space-4)), calc(-1 * var(--gridui-space-4))));
328
+ }
329
+ }
330
+ .gridui-button-group {
331
+ --gridui-button-group-padding-block: var(--gridui-space-24);
332
+ container: gridui-button-group / inline-size;
333
+ min-width: 0;
334
+ }
335
+ .gridui-button-group-items {
336
+ display: grid;
337
+ grid-auto-flow: column;
338
+ grid-auto-columns: minmax(0, 1fr);
339
+ align-items: stretch;
340
+ }
341
+ .gridui-button-group-items[data-layout="standard"] {
342
+ gap: var(--gridui-space-8);
343
+ }
344
+ .gridui-button-group-items[data-layout="cells"] > [data-gridui-button-group-item]:not([hidden]) ~ [data-gridui-button-group-item]:not([hidden])::before {
345
+ position: absolute;
346
+ inset-block: 0;
347
+ inset-inline-start: 0;
348
+ width: 1px;
349
+ background: var(--gridui-button-group-border, var(--gridui-border));
350
+ pointer-events: none;
351
+ content: "";
352
+ }
353
+ @container gridui-button-group (max-width: 20rem) {
354
+ .gridui-button-group-items {
355
+ grid-auto-flow: row;
356
+ grid-auto-rows: 1fr;
357
+ }
358
+ .gridui-button-group-items[data-layout="cells"] > [data-gridui-button-group-item]:not([hidden]) ~ [data-gridui-button-group-item]:not([hidden])::before {
359
+ inset-block: 0 auto;
360
+ inset-inline: 0;
361
+ width: auto;
362
+ height: 1px;
363
+ }
364
+ }
365
+ }
366
+ @layer utilities {
367
+ .gridui-button-group-items > [data-gridui-button-group-item] {
368
+ position: relative;
369
+ width: 100%;
370
+ height: 100%;
371
+ min-width: 0;
372
+ }
373
+ .gridui-button-group-items[data-layout="cells"] > [data-gridui-button-group-item] {
374
+ min-height: 2.75rem;
375
+ padding: var(--gridui-button-group-padding-block) var(--gridui-space-24);
376
+ border: 0;
377
+ border-radius: 0;
378
+ }
379
+ }
380
+ @property --tw-border-style {
381
+ syntax: "*";
382
+ inherits: false;
383
+ initial-value: solid;
384
+ }
385
+ @property --tw-duration {
386
+ syntax: "*";
387
+ inherits: false;
388
+ }
389
+ @property --tw-ease {
390
+ syntax: "*";
391
+ inherits: false;
392
+ }
393
+ @layer properties {
394
+ @supports ((-webkit-hyphens: none) and (not (margin-trim: block))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
395
+ *, ::before, ::after, ::backdrop {
396
+ --tw-border-style: solid;
397
+ --tw-duration: initial;
398
+ --tw-ease: initial;
399
+ }
400
+ }
401
+ }
402
+
403
+ /*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
404
+ @layer properties;
405
+ @layer theme, base, components, utilities;
406
+ @layer theme {
407
+ :root, :host {
408
+ --spacing: 0.25rem;
409
+ }
410
+ }
411
+ @layer utilities {
412
+ .gridui-u-overlay--z-\(--gridui-z-popover\) {
413
+ z-index: var(--gridui-z-popover);
414
+ }
415
+ .gridui-u-overlay--flex {
416
+ display: flex;
417
+ }
418
+ .gridui-u-overlay--inline-flex {
419
+ display: inline-flex;
420
+ }
421
+ .gridui-u-overlay--size-gridui-16 {
422
+ width: var(--gridui-space-16);
423
+ height: var(--gridui-space-16);
424
+ }
425
+ .gridui-u-overlay--min-h-10 {
426
+ min-height: calc(var(--spacing) * 10);
427
+ }
428
+ .gridui-u-overlay--min-w-0 {
429
+ min-width: 0px;
430
+ }
431
+ .gridui-u-overlay--shrink-0 {
432
+ flex-shrink: 0;
433
+ }
434
+ .gridui-u-overlay--cursor-pointer {
435
+ cursor: pointer;
436
+ }
437
+ .gridui-u-overlay--items-center {
438
+ align-items: center;
439
+ }
440
+ .gridui-u-overlay--justify-center {
441
+ justify-content: center;
442
+ }
443
+ .gridui-u-overlay--gap-gridui-8 {
444
+ gap: var(--gridui-space-8);
445
+ }
446
+ .gridui-u-overlay--rounded-control {
447
+ border-radius: var(--gridui-control-radius);
448
+ }
449
+ .gridui-u-overlay--border {
450
+ border-style: var(--tw-border-style);
451
+ border-width: 1px;
452
+ }
453
+ .gridui-u-overlay--border-solid {
454
+ --tw-border-style: solid;
455
+ border-style: solid;
456
+ }
457
+ .gridui-u-overlay--border-border {
458
+ border-color: var(--gridui-border);
459
+ }
460
+ .gridui-u-overlay--bg-background {
461
+ background-color: var(--gridui-background);
462
+ }
463
+ .gridui-u-overlay--p-0 {
464
+ padding: 0px;
465
+ }
466
+ .gridui-u-overlay--p-gridui-8 {
467
+ padding: var(--gridui-space-8);
468
+ }
469
+ .gridui-u-overlay--px-gridui-8 {
470
+ padding-inline: var(--gridui-space-8);
471
+ }
472
+ .gridui-u-overlay--py-gridui-8 {
473
+ padding-block: var(--gridui-space-8);
474
+ }
475
+ .gridui-u-overlay--type-data {
476
+ font: var(--gridui-type-data);
477
+ font-family: var(--gridui-font-body);
478
+ letter-spacing: normal;
479
+ font-variant-numeric: tabular-nums;
480
+ }
481
+ .gridui-u-overlay--type-caption {
482
+ font: var(--gridui-type-caption);
483
+ font-family: var(--gridui-font-body);
484
+ letter-spacing: normal;
485
+ }
486
+ .gridui-u-overlay--wrap-anywhere {
487
+ overflow-wrap: anywhere;
488
+ }
489
+ .gridui-u-overlay--whitespace-normal {
490
+ white-space: normal;
491
+ }
492
+ .gridui-u-overlay--text-foreground {
493
+ color: var(--gridui-foreground);
494
+ }
495
+ .gridui-u-overlay--text-inherit {
496
+ color: inherit;
497
+ }
498
+ .gridui-u-overlay--text-muted {
499
+ color: var(--gridui-muted);
500
+ }
501
+ .gridui-u-overlay--no-underline {
502
+ text-decoration-line: none;
503
+ }
504
+ .gridui-u-overlay--aria-selected\:bg-selection-background[aria-selected="true"] {
505
+ background-color: var(--gridui-selection-background);
506
+ }
507
+ .gridui-u-overlay--aria-\[current\=page\]\:bg-selection-background[aria-current="page"] {
508
+ background-color: var(--gridui-selection-background);
509
+ }
510
+ .gridui-u-overlay--data-disabled\:pointer-events-none[data-disabled] {
511
+ pointer-events: none;
512
+ }
513
+ .gridui-u-overlay--data-disabled\:opacity-50[data-disabled] {
514
+ opacity: 50%;
515
+ }
516
+ .gridui-u-overlay--data-\[state\=checked\]\:bg-selection-background[data-state="checked"] {
517
+ background-color: var(--gridui-selection-background);
518
+ }
519
+ }
520
+ @layer components {
521
+ .gridui-overlay-surface {
522
+ --gridui-surface-offset-x: 0px;
523
+ --gridui-surface-offset-y: 0px;
524
+ --gridui-overlay-enter-duration: var(--gridui-motion-duration-normal);
525
+ --gridui-overlay-fill-mode: both;
526
+ transform-origin: var(--gridui-overlay-origin, center);
527
+ }
528
+ .gridui-overlay-dialog {
529
+ --gridui-overlay-fill-mode: none;
530
+ transform-origin: center;
531
+ }
532
+ .gridui-overlay-tooltip {
533
+ --gridui-overlay-enter-duration: var(--gridui-motion-duration-quick);
534
+ }
535
+ .gridui-overlay-floating[data-side="bottom"] {
536
+ --gridui-surface-offset-y: calc(-1 * var(--gridui-motion-distance));
537
+ }
538
+ .gridui-overlay-floating[data-side="top"] {
539
+ --gridui-surface-offset-y: var(--gridui-motion-distance);
540
+ }
541
+ .gridui-overlay-floating[data-side="left"] {
542
+ --gridui-surface-offset-x: var(--gridui-motion-distance);
543
+ }
544
+ .gridui-overlay-floating[data-side="right"] {
545
+ --gridui-surface-offset-x: calc(-1 * var(--gridui-motion-distance));
546
+ }
547
+ .gridui-overlay-surface[data-state="closed"] {
548
+ pointer-events: none;
549
+ }
550
+ .gridui-overlay-surface:not([data-side="none"]):is([data-state="open"], [data-state="delayed-open"], [data-state="instant-open"]) {
551
+ animation: var(--gridui-motion-animation, gridui-surface-enter calc(var(--gridui-overlay-enter-duration) * var(--gridui-motion-factor, 1)) var(--gridui-motion-ease-out) var(--gridui-overlay-fill-mode));
552
+ }
553
+ .gridui-overlay-surface:not([data-side="none"])[data-state="closed"] {
554
+ animation: var(--gridui-motion-animation, gridui-surface-exit calc(var(--gridui-motion-duration-quick) * var(--gridui-motion-factor, 1)) var(--gridui-motion-ease-in) var(--gridui-overlay-fill-mode));
555
+ }
556
+ .gridui-overlay-backdrop {
557
+ background: var(--gridui-backdrop);
558
+ @supports (color: color-mix(in lab, red, red)) {
559
+ background: color-mix(in srgb, var(--gridui-backdrop) var(--gridui-backdrop-opacity), transparent);
560
+ }
561
+ --gridui-overlay-enter-duration: var(--gridui-motion-duration-normal);
562
+ --gridui-overlay-exit-duration: var(--gridui-motion-duration-quick);
563
+ --gridui-overlay-fill-mode: none;
564
+ }
565
+ .gridui-overlay-backdrop-deliberate {
566
+ --gridui-overlay-enter-duration: var(--gridui-motion-duration-deliberate);
567
+ --gridui-overlay-exit-duration: var(--gridui-motion-duration-normal);
568
+ --gridui-overlay-fill-mode: both;
569
+ }
570
+ .gridui-overlay-backdrop[data-state="open"] {
571
+ animation: var(--gridui-motion-animation, gridui-fade-enter calc(var(--gridui-overlay-enter-duration) * var(--gridui-motion-factor, 1)) var(--gridui-motion-ease-out) var(--gridui-overlay-fill-mode));
572
+ }
573
+ .gridui-overlay-backdrop[data-state="closed"] {
574
+ animation: var(--gridui-motion-animation, gridui-fade-exit calc(var(--gridui-overlay-exit-duration) * var(--gridui-motion-factor, 1)) var(--gridui-motion-ease-in) var(--gridui-overlay-fill-mode));
575
+ }
576
+ @media (prefers-reduced-motion: reduce) {
577
+ .gridui-overlay-surface:not([data-side="none"])[data-state], .gridui-overlay-backdrop[data-state] {
578
+ animation: none;
579
+ }
580
+ }
581
+ }
582
+ @property --tw-border-style {
583
+ syntax: "*";
584
+ inherits: false;
585
+ initial-value: solid;
586
+ }
587
+ @layer properties {
588
+ @supports ((-webkit-hyphens: none) and (not (margin-trim: block))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
589
+ *, ::before, ::after, ::backdrop {
590
+ --tw-border-style: solid;
591
+ }
592
+ }
593
+ }
594
+
595
+ /*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
596
+ @layer theme, base, components, utilities;
597
+ @layer theme {
598
+ :root, :host {
599
+ --spacing: 0.25rem;
600
+ }
601
+ }
602
+ @layer utilities {
603
+ .gridui-u-dropdown-menu--flex {
604
+ display: flex;
605
+ }
606
+ .gridui-u-dropdown-menu--max-h-\(--radix-dropdown-menu-content-available-height\) {
607
+ max-height: var(--radix-dropdown-menu-content-available-height);
608
+ }
609
+ .gridui-u-dropdown-menu--max-w-\[calc\(100vw-2\*var\(--gridui-page-gutter\)\)\] {
610
+ max-width: calc(100vw - 2 * var(--gridui-page-gutter));
611
+ }
612
+ .gridui-u-dropdown-menu--min-w-0 {
613
+ min-width: 0px;
614
+ }
615
+ .gridui-u-dropdown-menu--min-w-44 {
616
+ min-width: calc(var(--spacing) * 44);
617
+ }
618
+ .gridui-u-dropdown-menu--flex-1 {
619
+ flex: 1;
620
+ }
621
+ .gridui-u-dropdown-menu--items-center {
622
+ align-items: center;
623
+ }
624
+ .gridui-u-dropdown-menu--gap-gridui-8 {
625
+ gap: var(--gridui-space-8);
626
+ }
627
+ .gridui-u-dropdown-menu--overflow-y-auto {
628
+ overflow-y: auto;
629
+ }
630
+ }
631
+ @layer components {
632
+ .gridui-dropdown-content {
633
+ --gridui-overlay-origin: var(--radix-dropdown-menu-content-transform-origin);
634
+ }
635
+ .gridui-dropdown-content[data-morph-measuring][data-state="open"] {
636
+ animation: none;
637
+ }
638
+ @supports (clip-path: inset(0)) {
639
+ .gridui-dropdown-content[data-morph-ready][data-state="open"] {
640
+ animation: var(--gridui-motion-animation, gridui-menu-morph calc(var(--gridui-motion-duration-normal) * var(--gridui-motion-factor, 1)) var(--gridui-motion-ease-out));
641
+ }
642
+ }
643
+ @media (prefers-reduced-motion: reduce) {
644
+ .gridui-dropdown-content[data-morph-ready][data-state="open"] {
645
+ animation: none;
646
+ }
647
+ }
648
+ @keyframes gridui-menu-morph {
649
+ from {
650
+ clip-path: var(--gridui-menu-morph-clip);
651
+ opacity: 0.6;
652
+ transform: translate(var(--gridui-menu-morph-offset));
653
+ }
654
+ to {
655
+ clip-path: inset(0);
656
+ opacity: 1;
657
+ transform: translate(0, 0);
658
+ }
659
+ }
660
+ }
661
+
662
+ /*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
663
+ @layer theme, base, components, utilities;
664
+ @layer utilities {
665
+ .gridui-u-tooltip--z-\(--gridui-z-tooltip\) {
666
+ z-index: var(--gridui-z-tooltip);
667
+ }
668
+ .gridui-u-tooltip--box-border {
669
+ box-sizing: border-box;
670
+ }
671
+ .gridui-u-tooltip--w-max {
672
+ width: max-content;
673
+ }
674
+ .gridui-u-tooltip--max-w-\[min\(20rem\,var\(--radix-tooltip-content-available-width\)\)\] {
675
+ max-width: min(20rem, var(--radix-tooltip-content-available-width));
676
+ }
677
+ .gridui-u-tooltip--p-gridui-8 {
678
+ padding: var(--gridui-space-8);
679
+ }
680
+ .gridui-u-tooltip--type-supporting {
681
+ font: var(--gridui-type-supporting);
682
+ font-family: var(--gridui-font-body);
683
+ letter-spacing: normal;
684
+ }
685
+ .gridui-u-tooltip--wrap-anywhere {
686
+ overflow-wrap: anywhere;
687
+ }
688
+ }
689
+ @layer components {
690
+ .gridui-tooltip-content {
691
+ --gridui-overlay-origin: var(--radix-tooltip-content-transform-origin);
692
+ }
693
+ }
694
+
1
695
  /*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
2
696
  @layer properties;
3
697
  @layer theme, base, components, utilities;
@@ -51,6 +745,7 @@
51
745
  }
52
746
  .gridui-u-preferences--type-caption {
53
747
  font: var(--gridui-type-caption);
748
+ font-family: var(--gridui-font-body);
54
749
  letter-spacing: normal;
55
750
  }
56
751
  .gridui-u-preferences--text-muted {
@@ -81,14 +776,14 @@
81
776
  :is(.gridui-u-preferences--\*\:whitespace-normal > *) {
82
777
  white-space: normal;
83
778
  }
84
- :is(.gridui-u-preferences--\*\:aria-pressed\:bg-brand-tint > *)[aria-pressed="true"] {
85
- background-color: var(--gridui-brand-tint);
779
+ :is(.gridui-u-preferences--\*\:aria-pressed\:bg-selection-background > *)[aria-pressed="true"] {
780
+ background-color: var(--gridui-selection-background);
86
781
  }
87
782
  :is(.gridui-u-preferences--\*\:aria-pressed\:text-foreground > *)[aria-pressed="true"] {
88
783
  color: var(--gridui-foreground);
89
784
  }
90
- :is(.gridui-u-preferences--\*\:aria-\[current\=page\]\:bg-brand-tint > *)[aria-current="page"] {
91
- background-color: var(--gridui-brand-tint);
785
+ :is(.gridui-u-preferences--\*\:aria-\[current\=page\]\:bg-selection-background > *)[aria-current="page"] {
786
+ background-color: var(--gridui-selection-background);
92
787
  }
93
788
  :is(.gridui-u-preferences--\*\:aria-\[current\=page\]\:text-foreground > *)[aria-current="page"] {
94
789
  color: var(--gridui-foreground);
@@ -116,6 +811,7 @@
116
811
  }
117
812
  .gridui-u-preferences--\[\&_\>_a\]\:type-ui > a {
118
813
  font: var(--gridui-type-ui);
814
+ font-family: var(--gridui-font-body);
119
815
  letter-spacing: normal;
120
816
  }
121
817
  .gridui-u-preferences--\[\&_\>_a\]\:text-foreground > a {
@@ -0,0 +1,141 @@
1
+ /*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
2
+ @layer properties;
3
+ @layer theme, base, components, utilities;
4
+ @layer utilities {
5
+ .gridui-u-preferences--m-0 {
6
+ margin: 0px;
7
+ }
8
+ .gridui-u-preferences--flex {
9
+ display: flex;
10
+ }
11
+ .gridui-u-preferences--grid {
12
+ display: grid;
13
+ }
14
+ .gridui-u-preferences--min-w-0 {
15
+ min-width: 0px;
16
+ }
17
+ .gridui-u-preferences--flex-1 {
18
+ flex: 1;
19
+ }
20
+ .gridui-u-preferences--flex-wrap {
21
+ flex-wrap: wrap;
22
+ }
23
+ .gridui-u-preferences--items-stretch {
24
+ align-items: stretch;
25
+ }
26
+ .gridui-u-preferences--gap-gridui-8 {
27
+ gap: var(--gridui-space-8);
28
+ }
29
+ .gridui-u-preferences--gap-gridui-24 {
30
+ gap: var(--gridui-space-24);
31
+ }
32
+ .gridui-u-preferences--gap-px {
33
+ gap: 1px;
34
+ }
35
+ .gridui-u-preferences--rounded-control {
36
+ border-radius: var(--gridui-control-radius);
37
+ }
38
+ .gridui-u-preferences--border {
39
+ border-style: var(--tw-border-style);
40
+ border-width: 1px;
41
+ }
42
+ .gridui-u-preferences--border-solid {
43
+ --tw-border-style: solid;
44
+ border-style: solid;
45
+ }
46
+ .gridui-u-preferences--border-border {
47
+ border-color: var(--gridui-border);
48
+ }
49
+ .gridui-u-preferences--bg-border {
50
+ background-color: var(--gridui-border);
51
+ }
52
+ .gridui-u-preferences--type-caption {
53
+ font: var(--gridui-type-caption);
54
+ font-family: var(--gridui-font-body);
55
+ letter-spacing: normal;
56
+ }
57
+ .gridui-u-preferences--text-muted {
58
+ color: var(--gridui-muted);
59
+ }
60
+ :is(.gridui-u-preferences--\*\:max-w-full > *) {
61
+ max-width: 100%;
62
+ }
63
+ :is(.gridui-u-preferences--\*\:min-w-0 > *) {
64
+ min-width: 0px;
65
+ }
66
+ :is(.gridui-u-preferences--\*\:flex-\[1_1_auto\] > *) {
67
+ flex: 1 1 auto;
68
+ }
69
+ :is(.gridui-u-preferences--\*\:rounded-none > *) {
70
+ border-radius: 0;
71
+ }
72
+ :is(.gridui-u-preferences--\*\:border-0 > *) {
73
+ border-style: var(--tw-border-style);
74
+ border-width: 0px;
75
+ }
76
+ :is(.gridui-u-preferences--\*\:bg-background > *) {
77
+ background-color: var(--gridui-background);
78
+ }
79
+ :is(.gridui-u-preferences--\*\:wrap-anywhere > *) {
80
+ overflow-wrap: anywhere;
81
+ }
82
+ :is(.gridui-u-preferences--\*\:whitespace-normal > *) {
83
+ white-space: normal;
84
+ }
85
+ :is(.gridui-u-preferences--\*\:aria-pressed\:bg-selection-background > *)[aria-pressed="true"] {
86
+ background-color: var(--gridui-selection-background);
87
+ }
88
+ :is(.gridui-u-preferences--\*\:aria-pressed\:text-foreground > *)[aria-pressed="true"] {
89
+ color: var(--gridui-foreground);
90
+ }
91
+ :is(.gridui-u-preferences--\*\:aria-\[current\=page\]\:bg-selection-background > *)[aria-current="page"] {
92
+ background-color: var(--gridui-selection-background);
93
+ }
94
+ :is(.gridui-u-preferences--\*\:aria-\[current\=page\]\:text-foreground > *)[aria-current="page"] {
95
+ color: var(--gridui-foreground);
96
+ }
97
+ .gridui-u-preferences--\[\&_\>_a\]\:inline-flex > a {
98
+ display: inline-flex;
99
+ }
100
+ .gridui-u-preferences--\[\&_\>_a\]\:min-h-gridui-control-small > a {
101
+ min-height: var(--gridui-control-min-height-small);
102
+ }
103
+ .gridui-u-preferences--\[\&_\>_a\]\:items-center > a {
104
+ align-items: center;
105
+ }
106
+ .gridui-u-preferences--\[\&_\>_a\]\:justify-center > a {
107
+ justify-content: center;
108
+ }
109
+ .gridui-u-preferences--\[\&_\>_a\]\:gap-gridui-4 > a {
110
+ gap: var(--gridui-space-4);
111
+ }
112
+ .gridui-u-preferences--\[\&_\>_a\]\:px-gridui-8 > a {
113
+ padding-inline: var(--gridui-space-8);
114
+ }
115
+ .gridui-u-preferences--\[\&_\>_a\]\:py-gridui-4 > a {
116
+ padding-block: var(--gridui-space-4);
117
+ }
118
+ .gridui-u-preferences--\[\&_\>_a\]\:type-ui > a {
119
+ font: var(--gridui-type-ui);
120
+ font-family: var(--gridui-font-body);
121
+ letter-spacing: normal;
122
+ }
123
+ .gridui-u-preferences--\[\&_\>_a\]\:text-foreground > a {
124
+ color: var(--gridui-foreground);
125
+ }
126
+ .gridui-u-preferences--\[\&_\>_a\]\:no-underline > a {
127
+ text-decoration-line: none;
128
+ }
129
+ }
130
+ @property --tw-border-style {
131
+ syntax: "*";
132
+ inherits: false;
133
+ initial-value: solid;
134
+ }
135
+ @layer properties {
136
+ @supports ((-webkit-hyphens: none) and (not (margin-trim: block))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
137
+ *, ::before, ::after, ::backdrop {
138
+ --tw-border-style: solid;
139
+ }
140
+ }
141
+ }
package/docs/catalog.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "name": "@gridui/preferences",
4
- "version": "1.1.0",
4
+ "version": "1.3.0",
5
5
  "category": "core",
6
6
  "description": "GridUI React preferences",
7
7
  "usage": "Overlay supplies the selection indicator used by both presentations. The dropdown presentation also composes DropdownMenu and Tooltip. Applications own routes, labels, state persistence, and branding.",
@@ -40,6 +40,7 @@
40
40
  "@gridui/tooltip/styles.css",
41
41
  "@gridui/preferences/styles.css"
42
42
  ],
43
+ "styledImport": "@gridui/preferences/styled",
43
44
  "examples": [
44
45
  "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/preferences/stories/getting-started.mdx",
45
46
  "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/preferences/stories/preferences.mdx",
@@ -19,6 +19,10 @@ The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/
19
19
 
20
20
  The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
21
21
 
22
+ ### portalContainer
23
+
24
+ ``Element | DocumentFragment | null | undefined`` · Optional
25
+
22
26
  ### selectionAppearance
23
27
 
24
28
  ``SelectionAppearance | undefined`` · Optional
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridui/preferences",
3
- "version": "1.1.0",
3
+ "version": "1.3.0",
4
4
  "description": "GridUI React preferences",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -10,14 +10,19 @@
10
10
  "docs"
11
11
  ],
12
12
  "sideEffects": [
13
- "**/*.css"
13
+ "**/*.css",
14
+ "./dist/styled.js"
14
15
  ],
15
16
  "exports": {
16
17
  ".": {
17
18
  "types": "./dist/index.d.ts",
18
19
  "import": "./dist/index.js"
19
20
  },
20
- "./styles.css": "./dist/styles.css"
21
+ "./styles.css": "./dist/styles.css",
22
+ "./styled": {
23
+ "types": "./dist/index.d.ts",
24
+ "import": "./dist/styled.js"
25
+ }
21
26
  },
22
27
  "publishConfig": {
23
28
  "access": "public"
@@ -27,12 +32,12 @@
27
32
  "react-dom": "^19.2.0"
28
33
  },
29
34
  "dependencies": {
30
- "@gridui/button": "^5.0.1",
31
- "@gridui/dropdown-menu": "^2.1.0",
32
- "@gridui/overlay": "^2.2.0",
35
+ "@gridui/button": "^5.2.0",
36
+ "@gridui/dropdown-menu": "^3.1.0",
37
+ "@gridui/overlay": "^2.4.0",
33
38
  "@gridui/style-utils": "^4.0.0",
34
- "@gridui/theme": "^2.6.0",
35
- "@gridui/tooltip": "^1.0.7",
39
+ "@gridui/theme": "^4.0.0",
40
+ "@gridui/tooltip": "^1.2.0",
36
41
  "class-variance-authority": "0.7.1",
37
42
  "lucide-react": "1.72.0"
38
43
  },
@@ -49,6 +54,14 @@
49
54
  "react-dom": "19.3.1",
50
55
  "typescript": "6.0.3"
51
56
  },
57
+ "gridui": {
58
+ "styleOrder": [
59
+ "@gridui/button",
60
+ "@gridui/overlay",
61
+ "@gridui/dropdown-menu",
62
+ "@gridui/tooltip"
63
+ ]
64
+ },
52
65
  "scripts": {
53
66
  "build": "node ../../scripts/compilation/package.ts",
54
67
  "compile": "tsc --project tsconfig.json"