@gridui/preferences 1.0.4 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -81,7 +81,7 @@ var preferencesLabelStyles = cva(cn(
81
81
  var preferencesOptionsStyles = cva(cn(
82
82
  "gridui-preferences-options",
83
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-9 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",
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
85
  "gridui-u-*:aria-[current=page]:text-foreground gridui-u-*:aria-[current=page]:bg-brand-tint",
86
86
  "gridui-u-*:aria-pressed:text-foreground gridui-u-*:aria-pressed:bg-brand-tint"
87
87
  ));
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-9 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"],
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
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;A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1,6 @@
1
- /*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
1
+ /*! tailwindcss v4.3.4 | MIT License | https://tailwindcss.com */
2
2
  @layer properties;
3
3
  @layer theme, base, components, utilities;
4
- @layer theme {
5
- :root, :host {
6
- --spacing: 0.25rem;
7
- }
8
- }
9
4
  @layer utilities {
10
5
  .gridui-u-m-0 {
11
6
  margin: 0px;
@@ -67,8 +62,8 @@
67
62
  .gridui-u-\[\&_\>_a\]\:inline-flex > a {
68
63
  display: inline-flex;
69
64
  }
70
- .gridui-u-\[\&_\>_a\]\:min-h-9 > a {
71
- min-height: calc(var(--spacing) * 9);
65
+ .gridui-u-\[\&_\>_a\]\:min-h-gridui-control-small > a {
66
+ min-height: var(--gridui-control-min-height-small);
72
67
  }
73
68
  .gridui-u-\[\&_\>_a\]\:items-center > a {
74
69
  align-items: center;
@@ -102,7 +97,7 @@
102
97
  initial-value: solid;
103
98
  }
104
99
  @layer properties {
105
- @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
100
+ @supports ((-webkit-hyphens: none) and (not (margin-trim: block))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
106
101
  *, ::before, ::after, ::backdrop {
107
102
  --tw-border-style: solid;
108
103
  }
@@ -0,0 +1,44 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "name": "@gridui/preferences",
4
+ "version": "1.0.7",
5
+ "category": "core",
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.",
8
+ "documentation": [
9
+ "README.md"
10
+ ],
11
+ "exports": [
12
+ {
13
+ "name": "PreferenceLabels",
14
+ "kind": "type",
15
+ "importPath": "@gridui/preferences"
16
+ },
17
+ {
18
+ "name": "PreferenceLanguage",
19
+ "kind": "type",
20
+ "importPath": "@gridui/preferences"
21
+ },
22
+ {
23
+ "name": "PreferencesControls",
24
+ "kind": "component",
25
+ "importPath": "@gridui/preferences"
26
+ },
27
+ {
28
+ "name": "PreferencesControlsProps",
29
+ "kind": "type",
30
+ "importPath": "@gridui/preferences"
31
+ }
32
+ ],
33
+ "styles": [
34
+ "@gridui/theme/styles.css",
35
+ "@gridui/button/styles.css",
36
+ "@gridui/overlay/styles.css",
37
+ "@gridui/dropdown-menu/styles.css",
38
+ "@gridui/tooltip/styles.css",
39
+ "@gridui/preferences/styles.css"
40
+ ],
41
+ "examples": [
42
+ "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/preferences/stories/preferences.stories.tsx"
43
+ ]
44
+ }
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@gridui/preferences",
3
- "version": "1.0.4",
3
+ "version": "1.0.7",
4
4
  "description": "GridUI React preferences",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "dist",
9
- "README.md"
9
+ "README.md",
10
+ "docs"
10
11
  ],
11
12
  "sideEffects": [
12
13
  "**/*.css"
@@ -26,18 +27,18 @@
26
27
  "react-dom": "^19.2.0"
27
28
  },
28
29
  "dependencies": {
29
- "@gridui/button": "^3.0.0",
30
- "@gridui/dropdown-menu": "^1.1.3",
31
- "@gridui/style-utils": "^2.1.4",
32
- "@gridui/theme": "^2.4.0",
33
- "@gridui/tooltip": "^1.0.3",
30
+ "@gridui/button": "^3.1.2",
31
+ "@gridui/dropdown-menu": "^1.1.7",
32
+ "@gridui/style-utils": "^2.2.2",
33
+ "@gridui/theme": "^2.5.3",
34
+ "@gridui/tooltip": "^1.0.5",
34
35
  "class-variance-authority": "0.7.1",
35
- "lucide-react": "1.66.0"
36
+ "lucide-react": "1.69.0"
36
37
  },
37
38
  "devDependencies": {
38
39
  "@gridui-internal/configuration": "0.0.0-internal",
39
40
  "@jest/globals": "30.5.2",
40
- "@storybook/react-vite": "10.6.5",
41
+ "@storybook/react-vite": "10.6.6",
41
42
  "@types/jest": "30.0.0",
42
43
  "@types/node": "26.6.6",
43
44
  "@types/react": "19.3.0",
@@ -49,8 +50,6 @@
49
50
  },
50
51
  "scripts": {
51
52
  "build": "node ../../scripts/compilation/package.ts",
52
- "compile": "tsc --project tsconfig.json",
53
- "test": "jest",
54
- "coverage": "jest --coverage"
53
+ "compile": "tsc --project tsconfig.json"
55
54
  }
56
55
  }