@gridui/preferences 1.0.7 → 1.0.8

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
@@ -2,8 +2,20 @@
2
2
 
3
3
  Core family. Public API: `PreferenceLabels`, `PreferenceLanguage`, `PreferencesControls`, `PreferencesControlsProps`.
4
4
 
5
- Import components from `@gridui/preferences` and load `@gridui/preferences/styles.css` after Theme.
6
- Load styles for any composed dependency used by this family. Applications own routes, labels, state persistence, and branding.
5
+ Import components from `@gridui/preferences` and load these styles in order:
6
+
7
+ ```css
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
+ @import "@gridui/preferences/styles.css";
14
+ ```
15
+
16
+ Overlay supplies the selection indicator used by both presentations. The dropdown
17
+ presentation also composes DropdownMenu and Tooltip. Applications own routes,
18
+ labels, state persistence, and branding.
7
19
 
8
20
  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).
9
21
 
package/dist/index.js CHANGED
@@ -68,22 +68,23 @@ import { cn } from "@gridui/style-utils";
68
68
  import { cva } from "class-variance-authority";
69
69
  var preferencesStyles = cva(cn(
70
70
  "gridui-preferences",
71
- "gridui-u-flex gridui-u-flex-wrap gridui-u-gap-gridui-8"
71
+ "gridui-u-preferences--flex gridui-u-preferences--flex-wrap gridui-u-preferences--gap-gridui-8"
72
72
  ));
73
73
  var preferencesInlineStyles = cva(cn(
74
74
  "gridui-preferences-inline",
75
- "gridui-u-grid gridui-u-gap-gridui-24"
75
+ "gridui-u-preferences--grid gridui-u-preferences--gap-gridui-24"
76
76
  ));
77
77
  var preferencesLabelStyles = cva(cn(
78
78
  "gridui-preferences-label",
79
- "gridui-u-m-0 gridui-u-text-muted gridui-u-type-caption"
79
+ "gridui-u-preferences--m-0 gridui-u-preferences--text-muted gridui-u-preferences--type-caption"
80
80
  ));
81
81
  var preferencesOptionsStyles = cva(cn(
82
82
  "gridui-preferences-options",
83
- "gridui-u-flex gridui-u-flex-wrap gridui-u-gap-gridui-4 gridui-u-p-gridui-4 gridui-u-border gridui-u-border-solid gridui-u-border-border gridui-u-rounded-control",
84
- "gridui-u-[&_>_a]:inline-flex gridui-u-[&_>_a]:min-h-gridui-control-small gridui-u-[&_>_a]:items-center gridui-u-[&_>_a]:gap-gridui-4 gridui-u-[&_>_a]:py-gridui-4 gridui-u-[&_>_a]:px-gridui-8 gridui-u-[&_>_a]:rounded-control gridui-u-[&_>_a]:text-foreground gridui-u-[&_>_a]:no-underline gridui-u-[&_>_a]:type-ui",
85
- "gridui-u-*:aria-[current=page]:text-foreground gridui-u-*:aria-[current=page]:bg-brand-tint",
86
- "gridui-u-*:aria-pressed:text-foreground gridui-u-*:aria-pressed:bg-brand-tint"
83
+ "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",
84
+ "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",
85
+ "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",
86
+ "gridui-u-preferences--*:aria-[current=page]:text-foreground gridui-u-preferences--*:aria-[current=page]:bg-brand-tint",
87
+ "gridui-u-preferences--*:aria-pressed:text-foreground gridui-u-preferences--*:aria-pressed:bg-brand-tint"
87
88
  ));
88
89
 
89
90
  // src/preferences-controls/dropdown.tsx
@@ -268,7 +269,7 @@ var InlinePreferences = (props) => {
268
269
  };
269
270
 
270
271
  // src/preferences-controls/preferences-controls.tsx
271
- import { dropdownIndicatorStyles } from "@gridui/dropdown-menu";
272
+ import { overlayListIndicatorStyles } from "@gridui/overlay";
272
273
  import { Check } from "lucide-react";
273
274
  import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
274
275
  var PreferencesControls = (props) => {
@@ -286,7 +287,14 @@ var PreferencesControls = (props) => {
286
287
  /* @__PURE__ */ jsx4(
287
288
  "span",
288
289
  {
289
- className: dropdownIndicatorStyles(),
290
+ className: "gridui-u-preferences--min-w-0 gridui-u-preferences--flex-1",
291
+ children: language.label
292
+ }
293
+ ),
294
+ /* @__PURE__ */ jsx4(
295
+ "span",
296
+ {
297
+ className: overlayListIndicatorStyles(),
290
298
  "aria-hidden": "true",
291
299
  children: language.current ? /* @__PURE__ */ jsx4(
292
300
  Check,
@@ -295,8 +303,7 @@ var PreferencesControls = (props) => {
295
303
  }
296
304
  ) : null
297
305
  }
298
- ),
299
- language.label
306
+ )
300
307
  ]
301
308
  },
302
309
  language.locale
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, DropdownMenuTrigger } from \"@gridui/dropdown-menu\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@gridui/tooltip\";\nimport { type FC, type ReactNode, useState } from \"react\";\n\nexport type PreferenceMenuProps = {\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 } = 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 {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-flex gridui-u-flex-wrap gridui-u-gap-gridui-8\",\n));\n\nexport const preferencesInlineStyles = cva(cn(\n \"gridui-preferences-inline\",\n \"gridui-u-grid gridui-u-gap-gridui-24\",\n));\n\nexport const preferencesLabelStyles = cva(cn(\n \"gridui-preferences-label\",\n \"gridui-u-m-0 gridui-u-text-muted gridui-u-type-caption\",\n));\n\nexport const preferencesOptionsStyles = cva(cn(\n \"gridui-preferences-options\",\n \"gridui-u-flex gridui-u-flex-wrap gridui-u-gap-gridui-4 gridui-u-p-gridui-4 gridui-u-border gridui-u-border-solid gridui-u-border-border gridui-u-rounded-control\",\n \"gridui-u-[&_>_a]:inline-flex gridui-u-[&_>_a]:min-h-gridui-control-small gridui-u-[&_>_a]:items-center gridui-u-[&_>_a]:gap-gridui-4 gridui-u-[&_>_a]:py-gridui-4 gridui-u-[&_>_a]:px-gridui-8 gridui-u-[&_>_a]:rounded-control gridui-u-[&_>_a]:text-foreground gridui-u-[&_>_a]:no-underline gridui-u-[&_>_a]:type-ui\",\n \"gridui-u-*:aria-[current=page]:text-foreground gridui-u-*:aria-[current=page]:bg-brand-tint\",\n \"gridui-u-*:aria-pressed:text-foreground gridui-u-*:aria-pressed:bg-brand-tint\",\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 { PreferencesOptions } 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, ReactElement } from \"react\";\n\nexport type DropdownPreferencesProps = PreferencesOptions & {\n readonly languageLinks: readonly ReactElement[];\n};\n\nexport const DropdownPreferences: FC<DropdownPreferencesProps> = (props: DropdownPreferencesProps) => {\n const { labels, theme, onThemeChange, languageLinks } = 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 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 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 { PreferencesOptions } from \"./types\";\nimport { Button } from \"@gridui/button\";\nimport { cn } from \"@gridui/style-utils\";\nimport { THEME } from \"@gridui/theme/theme\";\nimport type { FC, ReactElement } from \"react\";\n\nexport type InlinePreferencesProps = PreferencesOptions & {\n readonly languageLinks: readonly ReactElement[];\n};\n\nexport const InlinePreferences: FC<InlinePreferencesProps> = (props: InlinePreferencesProps) => {\n const { labels, theme, onThemeChange, languageLinks } = 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())}\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())}\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 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 { dropdownIndicatorStyles } from \"@gridui/dropdown-menu\";\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={dropdownIndicatorStyles()}\n aria-hidden=\"true\"\n >\n {language.current ? (<Check\n size={16}\n />) : null}\n </span>\n {language.label}\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,qBAAqB,2BAA2B;AACvE,SAAS,SAAS,gBAAgB,sBAAsB;AACxD,SAAkC,gBAAgB;AA2B1C,SAQY,KARZ;AAnBD,IAAM,iBAA0C,CAAC,UAA+B;AACnF,QAAM,EAAE,OAAO,MAAM,SAAS,IAAI;AAClC,QAAM;AAAA,IACF;AAAA,IACA;AAAA,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cesContent": ["/**\n * @author WMXPY\n * @package Preferences\n * @namespace PreferencesControls\n * @description Menu\n */\n\nimport { Button } from \"@gridui/button\";\nimport { DropdownMenu, DropdownMenuContent, DropdownMenuTrigger } from \"@gridui/dropdown-menu\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@gridui/tooltip\";\nimport { type FC, type ReactNode, useState } from \"react\";\n\nexport type PreferenceMenuProps = {\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 } = 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 {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-[current=page]:bg-brand-tint\",\n \"gridui-u-preferences--*:aria-pressed:text-foreground gridui-u-preferences--*:aria-pressed:bg-brand-tint\",\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 } = 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 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 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 { cn } from \"@gridui/style-utils\";\nimport { THEME } from \"@gridui/theme/theme\";\nimport type { FC } from \"react\";\n\nexport type InlinePreferencesProps = PreferencesViewOptions;\n\nexport const InlinePreferences: FC<InlinePreferencesProps> = (props: InlinePreferencesProps) => {\n const { labels, theme, onThemeChange, languageLinks } = 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())}\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())}\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 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,qBAAqB,2BAA2B;AACvE,SAAS,SAAS,gBAAgB,sBAAsB;AACxD,SAAkC,gBAAgB;AA2B1C,SAQY,KARZ;AAnBD,IAAM,iBAA0C,CAAC,UAA+B;AACnF,QAAM,EAAE,OAAO,MAAM,SAAS,IAAI;AAClC,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,OAAM;AAAA,kBAEL;AAAA;AAAA,cACL;AAAA;AAAA;AAAA,QACJ;AAAA,QACA,oBAAC,uBACI,UACL;AAAA;AAAA;AAAA,EACJ;AACJ;;;AC1DA,SAAS,UAAU;AACnB,SAAS,WAAW;AAEb,IAAM,oBAAoB,IAAI;AAAA,EACjC;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AA,cAET,mBAAS;AAAA;AAAA,UACd;AAAA,UACA,gBAAAA;AAAA,YAAC;AAAA;AAAA,cACG,WAAW,2BAA2B;AAAA,cACtC,eAAY;AAAA,cAEX,mBAAS,UAAW,gBAAAA;AAAA,gBAAC;AAAA;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,gBAAAA;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;",
6
6
  "names": ["cn", "jsx", "jsxs", "Button", "cn", "THEME", "jsx", "jsxs", "jsx", "jsxs"]
7
7
  }
@@ -4,9 +4,7 @@
4
4
  * @namespace PreferencesControls
5
5
  * @description Dropdown
6
6
  */
7
- import type { PreferencesOptions } from "./types";
8
- import type { FC, ReactElement } from "react";
9
- export type DropdownPreferencesProps = PreferencesOptions & {
10
- readonly languageLinks: readonly ReactElement[];
11
- };
7
+ import type { PreferencesViewOptions } from "./types";
8
+ import type { FC } from "react";
9
+ export type DropdownPreferencesProps = PreferencesViewOptions;
12
10
  export declare const DropdownPreferences: FC<DropdownPreferencesProps>;
@@ -4,9 +4,7 @@
4
4
  * @namespace PreferencesControls
5
5
  * @description Inline
6
6
  */
7
- import type { PreferencesOptions } from "./types";
8
- import type { FC, ReactElement } from "react";
9
- export type InlinePreferencesProps = PreferencesOptions & {
10
- readonly languageLinks: readonly ReactElement[];
11
- };
7
+ import type { PreferencesViewOptions } from "./types";
8
+ import type { FC } from "react";
9
+ export type InlinePreferencesProps = PreferencesViewOptions;
12
10
  export declare const InlinePreferences: FC<InlinePreferencesProps>;
@@ -5,6 +5,7 @@
5
5
  * @description Types
6
6
  */
7
7
  import type { THEME } from "@gridui/theme/theme";
8
+ import type { ReactElement } from "react";
8
9
  export type PreferenceLabels = {
9
10
  readonly language: string;
10
11
  readonly appearance: string;
@@ -17,3 +18,6 @@ export type PreferencesOptions = {
17
18
  readonly theme: THEME;
18
19
  readonly onThemeChange: (value: THEME) => void;
19
20
  };
21
+ export type PreferencesViewOptions = PreferencesOptions & {
22
+ readonly languageLinks: readonly ReactElement[];
23
+ };
package/dist/styles.css CHANGED
@@ -1,93 +1,127 @@
1
- /*! tailwindcss v4.3.4 | MIT License | https://tailwindcss.com */
1
+ /*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
2
2
  @layer properties;
3
3
  @layer theme, base, components, utilities;
4
4
  @layer utilities {
5
- .gridui-u-m-0 {
5
+ .gridui-u-preferences--m-0 {
6
6
  margin: 0px;
7
7
  }
8
- .gridui-u-flex {
8
+ .gridui-u-preferences--flex {
9
9
  display: flex;
10
10
  }
11
- .gridui-u-grid {
11
+ .gridui-u-preferences--grid {
12
12
  display: grid;
13
13
  }
14
- .gridui-u-flex-wrap {
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 {
15
21
  flex-wrap: wrap;
16
22
  }
17
- .gridui-u-gap-gridui-4 {
18
- gap: var(--gridui-space-4);
23
+ .gridui-u-preferences--items-stretch {
24
+ align-items: stretch;
19
25
  }
20
- .gridui-u-gap-gridui-8 {
26
+ .gridui-u-preferences--gap-gridui-8 {
21
27
  gap: var(--gridui-space-8);
22
28
  }
23
- .gridui-u-gap-gridui-24 {
29
+ .gridui-u-preferences--gap-gridui-24 {
24
30
  gap: var(--gridui-space-24);
25
31
  }
26
- .gridui-u-rounded-control {
32
+ .gridui-u-preferences--gap-px {
33
+ gap: 1px;
34
+ }
35
+ .gridui-u-preferences--rounded-control {
27
36
  border-radius: var(--gridui-control-radius);
28
37
  }
29
- .gridui-u-border {
38
+ .gridui-u-preferences--border {
30
39
  border-style: var(--tw-border-style);
31
40
  border-width: 1px;
32
41
  }
33
- .gridui-u-border-solid {
42
+ .gridui-u-preferences--border-solid {
34
43
  --tw-border-style: solid;
35
44
  border-style: solid;
36
45
  }
37
- .gridui-u-border-border {
46
+ .gridui-u-preferences--border-border {
38
47
  border-color: var(--gridui-border);
39
48
  }
40
- .gridui-u-p-gridui-4 {
41
- padding: var(--gridui-space-4);
49
+ .gridui-u-preferences--bg-border {
50
+ background-color: var(--gridui-border);
42
51
  }
43
- .gridui-u-type-caption {
52
+ .gridui-u-preferences--type-caption {
44
53
  font: var(--gridui-type-caption);
45
54
  letter-spacing: normal;
46
55
  }
47
- .gridui-u-text-muted {
56
+ .gridui-u-preferences--text-muted {
48
57
  color: var(--gridui-muted);
49
58
  }
50
- :is(.gridui-u-\*\:aria-pressed\:bg-brand-tint > *)[aria-pressed="true"] {
59
+ :is(.gridui-u-preferences--\*\:max-w-full > *) {
60
+ max-width: 100%;
61
+ }
62
+ :is(.gridui-u-preferences--\*\:min-w-0 > *) {
63
+ min-width: 0px;
64
+ }
65
+ :is(.gridui-u-preferences--\*\:flex-\[1_1_auto\] > *) {
66
+ flex: 1 1 auto;
67
+ }
68
+ :is(.gridui-u-preferences--\*\:rounded-none > *) {
69
+ border-radius: 0;
70
+ }
71
+ :is(.gridui-u-preferences--\*\:border-0 > *) {
72
+ border-style: var(--tw-border-style);
73
+ border-width: 0px;
74
+ }
75
+ :is(.gridui-u-preferences--\*\:bg-background > *) {
76
+ background-color: var(--gridui-background);
77
+ }
78
+ :is(.gridui-u-preferences--\*\:wrap-anywhere > *) {
79
+ overflow-wrap: anywhere;
80
+ }
81
+ :is(.gridui-u-preferences--\*\:whitespace-normal > *) {
82
+ white-space: normal;
83
+ }
84
+ :is(.gridui-u-preferences--\*\:aria-pressed\:bg-brand-tint > *)[aria-pressed="true"] {
51
85
  background-color: var(--gridui-brand-tint);
52
86
  }
53
- :is(.gridui-u-\*\:aria-pressed\:text-foreground > *)[aria-pressed="true"] {
87
+ :is(.gridui-u-preferences--\*\:aria-pressed\:text-foreground > *)[aria-pressed="true"] {
54
88
  color: var(--gridui-foreground);
55
89
  }
56
- :is(.gridui-u-\*\:aria-\[current\=page\]\:bg-brand-tint > *)[aria-current="page"] {
90
+ :is(.gridui-u-preferences--\*\:aria-\[current\=page\]\:bg-brand-tint > *)[aria-current="page"] {
57
91
  background-color: var(--gridui-brand-tint);
58
92
  }
59
- :is(.gridui-u-\*\:aria-\[current\=page\]\:text-foreground > *)[aria-current="page"] {
93
+ :is(.gridui-u-preferences--\*\:aria-\[current\=page\]\:text-foreground > *)[aria-current="page"] {
60
94
  color: var(--gridui-foreground);
61
95
  }
62
- .gridui-u-\[\&_\>_a\]\:inline-flex > a {
96
+ .gridui-u-preferences--\[\&_\>_a\]\:inline-flex > a {
63
97
  display: inline-flex;
64
98
  }
65
- .gridui-u-\[\&_\>_a\]\:min-h-gridui-control-small > a {
99
+ .gridui-u-preferences--\[\&_\>_a\]\:min-h-gridui-control-small > a {
66
100
  min-height: var(--gridui-control-min-height-small);
67
101
  }
68
- .gridui-u-\[\&_\>_a\]\:items-center > a {
102
+ .gridui-u-preferences--\[\&_\>_a\]\:items-center > a {
69
103
  align-items: center;
70
104
  }
71
- .gridui-u-\[\&_\>_a\]\:gap-gridui-4 > a {
72
- gap: var(--gridui-space-4);
105
+ .gridui-u-preferences--\[\&_\>_a\]\:justify-center > a {
106
+ justify-content: center;
73
107
  }
74
- .gridui-u-\[\&_\>_a\]\:rounded-control > a {
75
- border-radius: var(--gridui-control-radius);
108
+ .gridui-u-preferences--\[\&_\>_a\]\:gap-gridui-4 > a {
109
+ gap: var(--gridui-space-4);
76
110
  }
77
- .gridui-u-\[\&_\>_a\]\:px-gridui-8 > a {
111
+ .gridui-u-preferences--\[\&_\>_a\]\:px-gridui-8 > a {
78
112
  padding-inline: var(--gridui-space-8);
79
113
  }
80
- .gridui-u-\[\&_\>_a\]\:py-gridui-4 > a {
114
+ .gridui-u-preferences--\[\&_\>_a\]\:py-gridui-4 > a {
81
115
  padding-block: var(--gridui-space-4);
82
116
  }
83
- .gridui-u-\[\&_\>_a\]\:type-ui > a {
117
+ .gridui-u-preferences--\[\&_\>_a\]\:type-ui > a {
84
118
  font: var(--gridui-type-ui);
85
119
  letter-spacing: normal;
86
120
  }
87
- .gridui-u-\[\&_\>_a\]\:text-foreground > a {
121
+ .gridui-u-preferences--\[\&_\>_a\]\:text-foreground > a {
88
122
  color: var(--gridui-foreground);
89
123
  }
90
- .gridui-u-\[\&_\>_a\]\:no-underline > a {
124
+ .gridui-u-preferences--\[\&_\>_a\]\:no-underline > a {
91
125
  text-decoration-line: none;
92
126
  }
93
127
  }
package/docs/catalog.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "name": "@gridui/preferences",
4
- "version": "1.0.7",
4
+ "version": "1.0.8",
5
5
  "category": "core",
6
6
  "description": "GridUI React preferences",
7
- "usage": "`PreferencesControls` is available from `@gridui/preferences` with dropdown or inline presentations. Applications supply language links, localized labels, the current theme, and its change callback. Dropdown icon buttons keep their accessible names and use the shared `@gridui/tooltip` Tooltip for supplemental hints: keyboard focus opens immediately, pointer hover uses the shared delay, and Escape dismisses the hint. A hint stays closed while its corresponding menu is open. Language links retain native navigation; inline theme buttons expose pressed state.",
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.",
8
8
  "documentation": [
9
9
  "README.md"
10
10
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridui/preferences",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "GridUI React preferences",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -27,13 +27,14 @@
27
27
  "react-dom": "^19.2.0"
28
28
  },
29
29
  "dependencies": {
30
- "@gridui/button": "^3.1.2",
31
- "@gridui/dropdown-menu": "^1.1.7",
32
- "@gridui/style-utils": "^2.2.2",
30
+ "@gridui/button": "^4.0.0",
31
+ "@gridui/dropdown-menu": "^2.0.0",
32
+ "@gridui/overlay": "^2.0.0",
33
+ "@gridui/style-utils": "^3.0.0",
33
34
  "@gridui/theme": "^2.5.3",
34
- "@gridui/tooltip": "^1.0.5",
35
+ "@gridui/tooltip": "^1.0.6",
35
36
  "class-variance-authority": "0.7.1",
36
- "lucide-react": "1.69.0"
37
+ "lucide-react": "1.70.0"
37
38
  },
38
39
  "devDependencies": {
39
40
  "@gridui-internal/configuration": "0.0.0-internal",