@womp/kookie-ui 0.12.0 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components.css +411 -592
- package/dist/cjs/hooks/appearance-script.d.ts +16 -0
- package/dist/cjs/hooks/appearance-script.d.ts.map +1 -0
- package/dist/cjs/hooks/appearance-script.js +12 -0
- package/dist/cjs/hooks/appearance-script.js.map +7 -0
- package/dist/cjs/hooks/index.d.ts +3 -0
- package/dist/cjs/hooks/index.d.ts.map +1 -1
- package/dist/cjs/hooks/index.js +12 -2
- package/dist/cjs/hooks/index.js.map +4 -4
- package/dist/cjs/hooks/use-appearance.d.ts +30 -0
- package/dist/cjs/hooks/use-appearance.d.ts.map +1 -0
- package/dist/cjs/hooks/use-appearance.js +12 -0
- package/dist/cjs/hooks/use-appearance.js.map +7 -0
- package/dist/cjs/index.js +15 -5
- package/dist/cjs/index.js.map +4 -4
- package/dist/esm/chunk-2KZ4NI3X.js +1 -0
- package/dist/esm/chunk-HT7RFHLW.js +2 -0
- package/dist/esm/chunk-HT7RFHLW.js.map +7 -0
- package/dist/esm/chunk-IUER6BNH.js +12 -0
- package/dist/esm/chunk-IUER6BNH.js.map +7 -0
- package/dist/esm/hooks/appearance-script.d.ts +16 -0
- package/dist/esm/hooks/appearance-script.d.ts.map +1 -0
- package/dist/esm/hooks/appearance-script.js +2 -0
- package/dist/esm/hooks/appearance-script.js.map +7 -0
- package/dist/esm/hooks/index.d.ts +3 -0
- package/dist/esm/hooks/index.d.ts.map +1 -1
- package/dist/esm/hooks/index.js +1 -1
- package/dist/esm/hooks/use-appearance.d.ts +30 -0
- package/dist/esm/hooks/use-appearance.d.ts.map +1 -0
- package/dist/esm/hooks/use-appearance.js +2 -0
- package/dist/esm/hooks/use-appearance.js.map +7 -0
- package/dist/esm/index.js +1 -1
- package/layout/tokens.css +4 -0
- package/layout.css +4 -0
- package/package.json +11 -1
- package/src/components/_internal/base-button.css +4 -4
- package/src/components/_internal/base-menu.css +3 -3
- package/src/components/_internal/base-tab-list.css +2 -2
- package/src/components/segmented-control.css +4 -4
- package/src/components/select.css +8 -5
- package/src/components/sidebar.css +41 -97
- package/src/components/text-field.css +3 -3
- package/src/components/toolbar.css +4 -4
- package/src/hooks/appearance-script.ts +28 -0
- package/src/hooks/index.ts +3 -0
- package/src/hooks/use-appearance.ts +119 -0
- package/src/styles/tokens/space.css +7 -0
- package/styles.css +415 -592
- package/tokens/base.css +4 -0
- package/tokens.css +4 -0
- package/dist/esm/chunk-EL7YGOTY.js +0 -1
- /package/dist/esm/{chunk-EL7YGOTY.js.map → chunk-2KZ4NI3X.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=chunk-2KZ4NI3X.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as n}from"./chunk-IUER6BNH.js";import*as h from"react";var o=new Set;function r(){for(let e of o)e()}function c(){try{let e=globalThis.localStorage?.getItem(n);return e==="light"||e==="dark"?e:"system"}catch{return"system"}}function a(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function i(e){let t=document.documentElement;t.classList.remove("light","dark"),t.classList.add(e),t.setAttribute("data-appearance",e),t.style.colorScheme=e}function u(){let e=document.documentElement;return e.classList.contains("dark")||e.classList.contains("dark-theme")?"dark":e.classList.contains("light")||e.classList.contains("light-theme")?"light":a()}var s=null;function v(){let e=c(),t=u();return(!s||s.choice!==e||s.resolved!==t)&&(s={choice:e,resolved:t}),s}var g={choice:"system",resolved:"light"};function f(e){o.add(e);let t=window.matchMedia("(prefers-color-scheme: dark)"),l=()=>{c()==="system"&&(i(a()),r())},p=m=>{if(m.key!==n)return;let d=c();i(d==="system"?a():d),r()};return t.addEventListener("change",l),window.addEventListener("storage",p),()=>{o.delete(e),t.removeEventListener("change",l),window.removeEventListener("storage",p)}}function A(e){try{e==="system"?localStorage.removeItem(n):localStorage.setItem(n,e)}catch{}i(e==="system"?a():e),r()}function S(){let{choice:e,resolved:t}=h.useSyncExternalStore(f,v,()=>g);return{choice:e,appearance:t,setAppearance:A}}export{A as a,S as b};
|
|
2
|
+
//# sourceMappingURL=chunk-HT7RFHLW.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/hooks/use-appearance.ts"],
|
|
4
|
+
"sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport { APPEARANCE_STORAGE_KEY } from './appearance-script.js';\n\n/**\n * Light and dark mode, decided before the first paint and kept on `<html>`.\n *\n * The server cannot know the visitor's mode, so `appearanceScript` runs synchronously in\n * `<head>`: the stored choice first, `prefers-color-scheme` otherwise. It writes the `light`\n * or `dark` class (which every token and component stylesheet already keys off) and\n * `data-appearance` on `<html>`. The root `<Theme>` keeps `appearance=\"inherit\"`, so it\n * writes no class of its own and `<html>` is the one source of truth. Nested themes and\n * portals inherit it from there.\n *\n * `useAppearance` is the client half: an external store over `<html>` and the same storage\n * key. It never mirrors the mode into React state that could disagree with the DOM.\n */\n\ntype AppearanceChoice = 'system' | 'light' | 'dark';\ntype ResolvedAppearance = 'light' | 'dark';\n\nconst listeners = new Set<() => void>();\n\nfunction emit() {\n for (const listener of listeners) listener();\n}\n\nfunction readChoice(): AppearanceChoice {\n try {\n const value = globalThis.localStorage?.getItem(APPEARANCE_STORAGE_KEY);\n return value === 'light' || value === 'dark' ? value : 'system';\n } catch {\n return 'system';\n }\n}\n\nfunction systemAppearance(): ResolvedAppearance {\n return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n}\n\nfunction stamp(mode: ResolvedAppearance) {\n const root = document.documentElement;\n root.classList.remove('light', 'dark');\n root.classList.add(mode);\n root.setAttribute('data-appearance', mode);\n root.style.colorScheme = mode;\n}\n\nfunction readResolved(): ResolvedAppearance {\n const root = document.documentElement;\n if (root.classList.contains('dark') || root.classList.contains('dark-theme')) return 'dark';\n if (root.classList.contains('light') || root.classList.contains('light-theme')) return 'light';\n return systemAppearance();\n}\n\nlet snapshot: { choice: AppearanceChoice; resolved: ResolvedAppearance } | null = null;\n\nfunction getSnapshot() {\n const choice = readChoice();\n const resolved = readResolved();\n if (!snapshot || snapshot.choice !== choice || snapshot.resolved !== resolved) {\n snapshot = { choice, resolved };\n }\n return snapshot;\n}\n\nconst serverSnapshot = { choice: 'system' as AppearanceChoice, resolved: 'light' as ResolvedAppearance };\n\nfunction subscribe(listener: () => void) {\n listeners.add(listener);\n const media = window.matchMedia('(prefers-color-scheme: dark)');\n // With no stored choice, follow the system as it changes.\n const onSystemChange = () => {\n if (readChoice() === 'system') {\n stamp(systemAppearance());\n emit();\n }\n };\n // Another tab changed the choice.\n const onStorage = (event: StorageEvent) => {\n if (event.key !== APPEARANCE_STORAGE_KEY) return;\n const choice = readChoice();\n stamp(choice === 'system' ? systemAppearance() : choice);\n emit();\n };\n media.addEventListener('change', onSystemChange);\n window.addEventListener('storage', onStorage);\n return () => {\n listeners.delete(listener);\n media.removeEventListener('change', onSystemChange);\n window.removeEventListener('storage', onStorage);\n };\n}\n\n/** Applies a choice to `<html>` and stores it. The change applies even if storage is blocked. */\nfunction setAppearance(choice: AppearanceChoice) {\n try {\n if (choice === 'system') localStorage.removeItem(APPEARANCE_STORAGE_KEY);\n else localStorage.setItem(APPEARANCE_STORAGE_KEY, choice);\n } catch {\n // Storage is blocked: the mode still changes for this page.\n }\n stamp(choice === 'system' ? systemAppearance() : choice);\n emit();\n}\n\n/**\n * The page's light or dark mode. `choice` is what the person picked (`system` when they\n * haven't); `appearance` is what is showing. On the server and in the first client render it\n * reports `system` / `light`, then corrects without a hydration mismatch.\n */\nfunction useAppearance() {\n const { choice, resolved } = React.useSyncExternalStore(subscribe, getSnapshot, () => serverSnapshot);\n return { choice, appearance: resolved, setAppearance } as const;\n}\n\nexport { useAppearance, setAppearance };\nexport type { AppearanceChoice, ResolvedAppearance };\n"],
|
|
5
|
+
"mappings": "wCAEA,UAAYA,MAAW,QAoBvB,IAAMC,EAAY,IAAI,IAEtB,SAASC,GAAO,CACd,QAAWC,KAAYF,EAAWE,EAAS,CAC7C,CAEA,SAASC,GAA+B,CACtC,GAAI,CACF,IAAMC,EAAQ,WAAW,cAAc,QAAQC,CAAsB,EACrE,OAAOD,IAAU,SAAWA,IAAU,OAASA,EAAQ,QACzD,MAAQ,CACN,MAAO,QACT,CACF,CAEA,SAASE,GAAuC,CAC9C,OAAO,OAAO,WAAW,8BAA8B,EAAE,QAAU,OAAS,OAC9E,CAEA,SAASC,EAAMC,EAA0B,CACvC,IAAMC,EAAO,SAAS,gBACtBA,EAAK,UAAU,OAAO,QAAS,MAAM,EACrCA,EAAK,UAAU,IAAID,CAAI,EACvBC,EAAK,aAAa,kBAAmBD,CAAI,EACzCC,EAAK,MAAM,YAAcD,CAC3B,CAEA,SAASE,GAAmC,CAC1C,IAAMD,EAAO,SAAS,gBACtB,OAAIA,EAAK,UAAU,SAAS,MAAM,GAAKA,EAAK,UAAU,SAAS,YAAY,EAAU,OACjFA,EAAK,UAAU,SAAS,OAAO,GAAKA,EAAK,UAAU,SAAS,aAAa,EAAU,QAChFH,EAAiB,CAC1B,CAEA,IAAIK,EAA8E,KAElF,SAASC,GAAc,CACrB,IAAMC,EAASV,EAAW,EACpBW,EAAWJ,EAAa,EAC9B,OAAI,CAACC,GAAYA,EAAS,SAAWE,GAAUF,EAAS,WAAaG,KACnEH,EAAW,CAAE,OAAAE,EAAQ,SAAAC,CAAS,GAEzBH,CACT,CAEA,IAAMI,EAAiB,CAAE,OAAQ,SAA8B,SAAU,OAA8B,EAEvG,SAASC,EAAUd,EAAsB,CACvCF,EAAU,IAAIE,CAAQ,EACtB,IAAMe,EAAQ,OAAO,WAAW,8BAA8B,EAExDC,EAAiB,IAAM,CACvBf,EAAW,IAAM,WACnBI,EAAMD,EAAiB,CAAC,EACxBL,EAAK,EAET,EAEMkB,EAAaC,GAAwB,CACzC,GAAIA,EAAM,MAAQf,EAAwB,OAC1C,IAAMQ,EAASV,EAAW,EAC1BI,EAAMM,IAAW,SAAWP,EAAiB,EAAIO,CAAM,EACvDZ,EAAK,CACP,EACA,OAAAgB,EAAM,iBAAiB,SAAUC,CAAc,EAC/C,OAAO,iBAAiB,UAAWC,CAAS,EACrC,IAAM,CACXnB,EAAU,OAAOE,CAAQ,EACzBe,EAAM,oBAAoB,SAAUC,CAAc,EAClD,OAAO,oBAAoB,UAAWC,CAAS,CACjD,CACF,CAGA,SAASE,EAAcR,EAA0B,CAC/C,GAAI,CACEA,IAAW,SAAU,aAAa,WAAWR,CAAsB,EAClE,aAAa,QAAQA,EAAwBQ,CAAM,CAC1D,MAAQ,CAER,CACAN,EAAMM,IAAW,SAAWP,EAAiB,EAAIO,CAAM,EACvDZ,EAAK,CACP,CAOA,SAASqB,GAAgB,CACvB,GAAM,CAAE,OAAAT,EAAQ,SAAAC,CAAS,EAAU,uBAAqBE,EAAWJ,EAAa,IAAMG,CAAc,EACpG,MAAO,CAAE,OAAAF,EAAQ,WAAYC,EAAU,cAAAO,CAAc,CACvD",
|
|
6
|
+
"names": ["React", "listeners", "emit", "listener", "readChoice", "value", "APPEARANCE_STORAGE_KEY", "systemAppearance", "stamp", "mode", "root", "readResolved", "snapshot", "getSnapshot", "choice", "resolved", "serverSnapshot", "subscribe", "media", "onSystemChange", "onStorage", "event", "setAppearance", "useAppearance"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
var e="kookie-appearance",a=`(function () {
|
|
2
|
+
var e = document.documentElement;
|
|
3
|
+
var a = null;
|
|
4
|
+
try { a = localStorage.getItem(${JSON.stringify(e)}); } catch (err) {}
|
|
5
|
+
var dark = a === "light" ? false : a === "dark" ? true : matchMedia("(prefers-color-scheme: dark)").matches;
|
|
6
|
+
var mode = dark ? "dark" : "light";
|
|
7
|
+
e.classList.remove("light", "dark");
|
|
8
|
+
e.classList.add(mode);
|
|
9
|
+
e.setAttribute("data-appearance", mode);
|
|
10
|
+
e.style.colorScheme = mode;
|
|
11
|
+
})();`;export{e as a,a as b};
|
|
12
|
+
//# sourceMappingURL=chunk-IUER6BNH.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/hooks/appearance-script.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * The pre-paint half of light and dark mode (see `use-appearance.ts`). Kept in its own module\n * with no client directive, so a server component such as a Next.js root layout can import the\n * string and inline it in `<head>`.\n */\n\nconst APPEARANCE_STORAGE_KEY = 'kookie-appearance';\n\n/**\n * Inline this in `<head>`, before any stylesheet paints, e.g.\n * `<script dangerouslySetInnerHTML={{ __html: appearanceScript }} />`.\n *\n * Storage is read inside its own try/catch: browsers that block site data throw on access,\n * and that must not skip the stamp. `matchMedia` always answers.\n */\nconst appearanceScript = `(function () {\n var e = document.documentElement;\n var a = null;\n try { a = localStorage.getItem(${JSON.stringify(APPEARANCE_STORAGE_KEY)}); } catch (err) {}\n var dark = a === \"light\" ? false : a === \"dark\" ? true : matchMedia(\"(prefers-color-scheme: dark)\").matches;\n var mode = dark ? \"dark\" : \"light\";\n e.classList.remove(\"light\", \"dark\");\n e.classList.add(mode);\n e.setAttribute(\"data-appearance\", mode);\n e.style.colorScheme = mode;\n})();`;\n\nexport { appearanceScript, APPEARANCE_STORAGE_KEY };\n"],
|
|
5
|
+
"mappings": "AAMA,IAAMA,EAAyB,oBASzBC,EAAmB;AAAA;AAAA;AAAA,mCAGU,KAAK,UAAUD,CAAsB,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
|
|
6
|
+
"names": ["APPEARANCE_STORAGE_KEY", "appearanceScript"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The pre-paint half of light and dark mode (see `use-appearance.ts`). Kept in its own module
|
|
3
|
+
* with no client directive, so a server component such as a Next.js root layout can import the
|
|
4
|
+
* string and inline it in `<head>`.
|
|
5
|
+
*/
|
|
6
|
+
declare const APPEARANCE_STORAGE_KEY = "kookie-appearance";
|
|
7
|
+
/**
|
|
8
|
+
* Inline this in `<head>`, before any stylesheet paints, e.g.
|
|
9
|
+
* `<script dangerouslySetInnerHTML={{ __html: appearanceScript }} />`.
|
|
10
|
+
*
|
|
11
|
+
* Storage is read inside its own try/catch: browsers that block site data throw on access,
|
|
12
|
+
* and that must not skip the stamp. `matchMedia` always answers.
|
|
13
|
+
*/
|
|
14
|
+
declare const appearanceScript: string;
|
|
15
|
+
export { appearanceScript, APPEARANCE_STORAGE_KEY };
|
|
16
|
+
//# sourceMappingURL=appearance-script.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appearance-script.d.ts","sourceRoot":"","sources":["../../../src/hooks/appearance-script.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,QAAA,MAAM,sBAAsB,sBAAsB,CAAC;AAEnD;;;;;;GAMG;AACH,QAAA,MAAM,gBAAgB,QAUhB,CAAC;AAEP,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,CAAC"}
|
|
@@ -2,4 +2,7 @@ export { useLiveAnnouncer } from './use-live-announcer.js';
|
|
|
2
2
|
export { useBodyPointerEventsCleanup } from './use-body-pointer-events-cleanup.js';
|
|
3
3
|
export { useTooltipWrapper } from './use-tooltip-wrapper.js';
|
|
4
4
|
export { useToggleState } from './use-toggle-state.js';
|
|
5
|
+
export { useAppearance, setAppearance } from './use-appearance.js';
|
|
6
|
+
export { appearanceScript, APPEARANCE_STORAGE_KEY } from './appearance-script.js';
|
|
7
|
+
export type { AppearanceChoice, ResolvedAppearance } from './use-appearance.js';
|
|
5
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAClF,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/esm/hooks/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-
|
|
1
|
+
import"../chunk-2KZ4NI3X.js";import{a as g,b as h}from"../chunk-HT7RFHLW.js";import{a as e,b as f}from"../chunk-IUER6BNH.js";import{a as d}from"../chunk-VK7RNXUO.js";import{a as c}from"../chunk-EE54S7YV.js";import{a as b}from"../chunk-MHANZINI.js";import{a}from"../chunk-2N2AQNJH.js";import"../chunk-OS3FCYZY.js";export{e as APPEARANCE_STORAGE_KEY,f as appearanceScript,g as setAppearance,h as useAppearance,b as useBodyPointerEventsCleanup,c as useLiveAnnouncer,d as useToggleState,a as useTooltipWrapper};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Light and dark mode, decided before the first paint and kept on `<html>`.
|
|
3
|
+
*
|
|
4
|
+
* The server cannot know the visitor's mode, so `appearanceScript` runs synchronously in
|
|
5
|
+
* `<head>`: the stored choice first, `prefers-color-scheme` otherwise. It writes the `light`
|
|
6
|
+
* or `dark` class (which every token and component stylesheet already keys off) and
|
|
7
|
+
* `data-appearance` on `<html>`. The root `<Theme>` keeps `appearance="inherit"`, so it
|
|
8
|
+
* writes no class of its own and `<html>` is the one source of truth. Nested themes and
|
|
9
|
+
* portals inherit it from there.
|
|
10
|
+
*
|
|
11
|
+
* `useAppearance` is the client half: an external store over `<html>` and the same storage
|
|
12
|
+
* key. It never mirrors the mode into React state that could disagree with the DOM.
|
|
13
|
+
*/
|
|
14
|
+
type AppearanceChoice = 'system' | 'light' | 'dark';
|
|
15
|
+
type ResolvedAppearance = 'light' | 'dark';
|
|
16
|
+
/** Applies a choice to `<html>` and stores it. The change applies even if storage is blocked. */
|
|
17
|
+
declare function setAppearance(choice: AppearanceChoice): void;
|
|
18
|
+
/**
|
|
19
|
+
* The page's light or dark mode. `choice` is what the person picked (`system` when they
|
|
20
|
+
* haven't); `appearance` is what is showing. On the server and in the first client render it
|
|
21
|
+
* reports `system` / `light`, then corrects without a hydration mismatch.
|
|
22
|
+
*/
|
|
23
|
+
declare function useAppearance(): {
|
|
24
|
+
readonly choice: AppearanceChoice;
|
|
25
|
+
readonly appearance: ResolvedAppearance;
|
|
26
|
+
readonly setAppearance: typeof setAppearance;
|
|
27
|
+
};
|
|
28
|
+
export { useAppearance, setAppearance };
|
|
29
|
+
export type { AppearanceChoice, ResolvedAppearance };
|
|
30
|
+
//# sourceMappingURL=use-appearance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-appearance.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-appearance.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;GAYG;AAEH,KAAK,gBAAgB,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;AACpD,KAAK,kBAAkB,GAAG,OAAO,GAAG,MAAM,CAAC;AA2E3C,iGAAiG;AACjG,iBAAS,aAAa,CAAC,MAAM,EAAE,gBAAgB,QAS9C;AAED;;;;GAIG;AACH,iBAAS,aAAa;;;;EAGrB;AAED,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,CAAC;AACxC,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-2KZ4NI3X.js";import{a as No,b as Oo}from"./chunk-HT7RFHLW.js";import{a as Lo,b as Mo}from"./chunk-IUER6BNH.js";import"./chunk-C7EVYSWK.js";import{a as zo}from"./chunk-UYCPDGWA.js";import{b as Ao,c as Bo,d as Co,e as Do,f as Eo}from"./chunk-XLMTTSRO.js";import"./chunk-ZUOK3KFY.js";import{a as Fo}from"./chunk-CYU6BLZ5.js";import"./chunk-4WVNMGI5.js";import{a as Go}from"./chunk-YWENWZOU.js";import{c as qo}from"./chunk-ALWNS44Q.js";import"./chunk-MN3XALXD.js";import{a as so,b as uo}from"./chunk-D6PHTHF2.js";import{a as yo}from"./chunk-6G3MPL4A.js";import{a as wo}from"./chunk-VK7RNXUO.js";import{a as vo}from"./chunk-EE54S7YV.js";import{c as jo}from"./chunk-K3UAS7RW.js";import"./chunk-AUV6B4AH.js";import{h as ko}from"./chunk-36A5BYCN.js";import"./chunk-BALS3AVM.js";import{e as lo}from"./chunk-VNH7BJOA.js";import"./chunk-TZTUPQYK.js";import{a as no}from"./chunk-EPTYNVCU.js";import"./chunk-CLMOWP5T.js";import{a as go}from"./chunk-VZSQATP6.js";import{a as ho}from"./chunk-43A5GUSI.js";import"./chunk-XI5YXUCK.js";import{a as io}from"./chunk-KJUDZCYK.js";import"./chunk-AF6XKU3W.js";import{h as Io}from"./chunk-MJOXEUBT.js";import"./chunk-2EQWBT2S.js";import{p as Ho}from"./chunk-53SZ4Y23.js";import"./chunk-2CMM7MEL.js";import"./chunk-OJU5GCDZ.js";import{c as xo}from"./chunk-FG7XM7KJ.js";import"./chunk-FC2DBBJ3.js";import{h as bo}from"./chunk-VHECAEUP.js";import"./chunk-EBQZ3Z22.js";import{a as co}from"./chunk-VR7ZAFYN.js";import"./chunk-CRSHBENJ.js";import{g as Jo}from"./chunk-ZK7A2MZZ.js";import"./chunk-ADXZNG4F.js";import{a as ao}from"./chunk-OGXZHAQL.js";import"./chunk-NIX6Z3JG.js";import{c as mo}from"./chunk-2I7QRVJ5.js";import"./chunk-VLTXI4A7.js";import{a as po}from"./chunk-CIYF56YS.js";import"./chunk-STPMPY3X.js";import{a as to}from"./chunk-FHEHX7CE.js";import{a as oo}from"./chunk-XEZXKPLE.js";import{a as ro}from"./chunk-CDG5WH4U.js";import"./chunk-5XV4QEP5.js";import{a as eo}from"./chunk-GLERJXVS.js";import"./chunk-MCQCG6AS.js";import{c as fo}from"./chunk-CRTH5LNU.js";import"./chunk-OWMA6GTG.js";import{a as _}from"./chunk-YBSRX63K.js";import"./chunk-AGSSWWFI.js";import{i as Ko}from"./chunk-OIUCV5HK.js";import{e as $}from"./chunk-7UHKEJ7Q.js";import"./chunk-Y3A6ZU24.js";import{a as Y}from"./chunk-IHK3H2OM.js";import{a as X}from"./chunk-S5C5YRBS.js";import"./chunk-IBF5U4QW.js";import"./chunk-L6UXAITB.js";import"./chunk-GFOSP3PZ.js";import{a as Z}from"./chunk-CSKZZOI2.js";import"./chunk-JAMLW534.js";import{d as W}from"./chunk-MEO7MJMQ.js";import"./chunk-VJSZG35J.js";import{e as R}from"./chunk-RNTCHVFI.js";import{g as T}from"./chunk-7JJT42J2.js";import{a as S}from"./chunk-MHANZINI.js";import{o as U}from"./chunk-MZXHKM4V.js";import"./chunk-WOR3JCLX.js";import{a as V}from"./chunk-7FC7HF76.js";import"./chunk-4JQZUQY7.js";import{a as M}from"./chunk-N4GTDLRD.js";import{l as O}from"./chunk-T4OR62DQ.js";import{g as N}from"./chunk-WHFJ4JUN.js";import"./chunk-72AHPGPN.js";import"./chunk-RDAMYQFF.js";import{a as P}from"./chunk-4ME6O27S.js";import"./chunk-PPNWGWN3.js";import{n as Q}from"./chunk-PQKJNRMR.js";import"./chunk-OA7C34MJ.js";import"./chunk-NIIEIZKQ.js";import{c as J}from"./chunk-METRW4HG.js";import{a as I}from"./chunk-VX6ARMWP.js";import"./chunk-667BKCUG.js";import"./chunk-HAGKI7NA.js";import{c as K}from"./chunk-OMGZG52I.js";import"./chunk-V32EP3S7.js";import"./chunk-5SNHUVDA.js";import{a as L}from"./chunk-KFR3CK24.js";import"./chunk-UICSVJ3B.js";import"./chunk-KZWNGWIM.js";import{a as u}from"./chunk-4YFJWXL2.js";import{d as y}from"./chunk-CKMMUHKE.js";import"./chunk-OGVKSYLL.js";import{m as H}from"./chunk-EGMUQQRW.js";import{b as F,c as G}from"./chunk-L5PID6BU.js";import{a as z}from"./chunk-ISOLUTZF.js";import{a as E}from"./chunk-COWZAUZR.js";import"./chunk-5GXFBLBJ.js";import"./chunk-UBOOUDS4.js";import"./chunk-XPRPYCII.js";import"./chunk-5BWLY27A.js";import{a as A,b as B,c as C,d as D}from"./chunk-IX5HIHVI.js";import{a as w}from"./chunk-3R4YLW4A.js";import{a as v}from"./chunk-2N2AQNJH.js";import{a as k}from"./chunk-Y7LT3F6R.js";import{a as l}from"./chunk-HJU4I34X.js";import"./chunk-PS6NEG5A.js";import"./chunk-QFPHEY77.js";import{a as q}from"./chunk-KMPE7TJ6.js";import{a as n}from"./chunk-OLAWVEAI.js";import"./chunk-BPVVFHYD.js";import"./chunk-QQ62LO3X.js";import{a as s}from"./chunk-MS5J4MF6.js";import"./chunk-FGORMEAO.js";import"./chunk-ROSWI2CL.js";import{a as b}from"./chunk-ERNM3KVF.js";import{f as c}from"./chunk-Y5RCH23Z.js";import"./chunk-EDKQURDU.js";import{h}from"./chunk-IYCPYN4Z.js";import"./chunk-MJJ7XDIP.js";import{a as g}from"./chunk-5WRCK4R7.js";import"./chunk-4XKK32M4.js";import"./chunk-XKBLNVOD.js";import"./chunk-GCUGJXI2.js";import{f as j}from"./chunk-54JFIP5S.js";import{a as i}from"./chunk-JDGJSNWT.js";import"./chunk-OO652UQW.js";import{a as d}from"./chunk-GO7OHBHW.js";import"./chunk-PZ7OYATT.js";import"./chunk-G2CKYO2I.js";import"./chunk-AXUDFYLY.js";import"./chunk-KNQBAOMV.js";import"./chunk-FD2TR343.js";import"./chunk-WYADYDPN.js";import"./chunk-ZE2KAVXW.js";import"./chunk-ZWZGUBL4.js";import"./chunk-7RQNB63F.js";import{a as t,b as x,c as a}from"./chunk-SEY4NA45.js";import"./chunk-WAURCNAS.js";import"./chunk-F22ZRNWL.js";import"./chunk-XYVLQDGR.js";import"./chunk-YAQBIO2B.js";import"./chunk-AGNIFHOE.js";import"./chunk-HCNO7PX6.js";import"./chunk-GMHA5CFH.js";import"./chunk-A2XVR7GL.js";import"./chunk-BZZXXZ3O.js";import"./chunk-2LYX5S7H.js";import"./chunk-HWQ3NTJP.js";import"./chunk-3J6AUDID.js";import"./chunk-4LDVSTXI.js";import{a as f}from"./chunk-HF5WY5YE.js";import"./chunk-3KB2XWBE.js";import{a as m}from"./chunk-AGAQC4HH.js";import"./chunk-5T6K7VPP.js";import{a as e}from"./chunk-FHOCUZDR.js";import"./chunk-SMGDH54W.js";import"./chunk-SNR5VFWG.js";import{b as o,c as r}from"./chunk-FWB47YCH.js";import"./chunk-K53W3ELO.js";import"./chunk-TTFUM47A.js";import"./chunk-VX44UTQ5.js";import"./chunk-ERGJN7FJ.js";import"./chunk-5TXQLK4G.js";import"./chunk-JFWMAYEH.js";import"./chunk-KRJTW535.js";import"./chunk-F6V7GBNQ.js";import"./chunk-3KSGRY6I.js";import"./chunk-ZOY43B55.js";import{a as p}from"./chunk-E67CIG6A.js";import"./chunk-ARIV4AT5.js";import"./chunk-3XSB7YIM.js";import"./chunk-YA5DF67M.js";import"./chunk-GSTOGDAJ.js";import"./chunk-6FLLFCBU.js";import"./chunk-AX5S56DS.js";import"./chunk-E23RKOQJ.js";import"./chunk-JUY7CBSL.js";import"./chunk-WRWNN2NW.js";import"./chunk-QM3RCK5P.js";import"./chunk-RZCX6IBE.js";import"./chunk-NZJGC6ZW.js";import"./chunk-WMGIFPI2.js";import"./chunk-CFNESRYI.js";import"./chunk-ZNK6AH2G.js";import"./chunk-JSW6J6RS.js";import"./chunk-OS3FCYZY.js";export{Lo as APPEARANCE_STORAGE_KEY,b as AccessibleIcon,c as Accordion,h as AlertDialog,j as AppBar,k as AspectRatio,l as Avatar,q as Badge,s as Blockquote,u as Box,w as Button,y as Callout,i as Card,H as Chatbar,L as Checkbox,J as CheckboxCards,K as CheckboxGroup,C as ChevronDownIcon,M as Code,O as Combobox,G as Confirmation,P as Container,Q as ContextMenu,R as DataList,T as Dialog,U as DropdownMenu,V as Em,e as Flex,I as Grid,d as Heading,W as HoverCard,z as IconButton,Y as Image,Z as Inset,p as Kbd,_ as Link,Ko as MessageScroller,$ as Navbar,F as Notice,N as Popover,oo as Portal,ro as Progress,eo as Quote,po as Radio,fo as RadioCards,mo as RadioGroup,to as Reset,E as ScrollArea,ao as Section,xo as SegmentedControl,bo as Select,co as Separator,Jo as Sheet,Io as Shell,Ho as Sidebar,X as Skeleton,go as Slider,o as Slot,r as Slottable,f as Spinner,ho as Strong,io as Switch,jo as TabNav,ko as Table,lo as Tabs,g as Text,no as TextArea,qo as TextField,a as Theme,t as ThemeContext,so as ThemePanel,uo as ThemePanelContent,B as ThickCheckIcon,D as ThickChevronRightIcon,A as ThickDividerHorizontalIcon,yo as ToggleButton,zo as ToggleIconButton,Eo as Toolbar,Bo as ToolbarButton,Ao as ToolbarGroup,Co as ToolbarSeparator,Do as ToolbarTitle,n as Tooltip,Fo as UserCard,Go as VirtualMenu,m as VisuallyHidden,Mo as appearanceScript,No as setAppearance,Oo as useAppearance,S as useBodyPointerEventsCleanup,vo as useLiveAnnouncer,x as useThemeContext,wo as useToggleState,v as useTooltipWrapper};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/layout/tokens.css
CHANGED
|
@@ -22,6 +22,10 @@
|
|
|
22
22
|
--space-6: calc(32px * var(--scaling));
|
|
23
23
|
--space-7: calc(40px * var(--scaling));
|
|
24
24
|
--space-8: calc(48px * var(--scaling));
|
|
25
|
+
--control-height-1: var(--space-5);
|
|
26
|
+
--control-height-2: var(--space-6);
|
|
27
|
+
--control-height-3: var(--space-7);
|
|
28
|
+
--control-height-4: var(--space-8);
|
|
25
29
|
--space-9: calc(64px * var(--scaling));
|
|
26
30
|
--space-10: calc(80px * var(--scaling));
|
|
27
31
|
--space-11: calc(96px * var(--scaling));
|
package/layout.css
CHANGED
|
@@ -22,6 +22,10 @@
|
|
|
22
22
|
--space-6: calc(32px * var(--scaling));
|
|
23
23
|
--space-7: calc(40px * var(--scaling));
|
|
24
24
|
--space-8: calc(48px * var(--scaling));
|
|
25
|
+
--control-height-1: var(--space-5);
|
|
26
|
+
--control-height-2: var(--space-6);
|
|
27
|
+
--control-height-3: var(--space-7);
|
|
28
|
+
--control-height-4: var(--space-8);
|
|
25
29
|
--space-9: calc(64px * var(--scaling));
|
|
26
30
|
--space-10: calc(80px * var(--scaling));
|
|
27
31
|
--space-11: calc(96px * var(--scaling));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@womp/kookie-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.1",
|
|
4
4
|
"description": "Kookie UI v1: a React component library with design tokens, flexible theming, a full layout shell, and comprehensive documentation.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -48,6 +48,16 @@
|
|
|
48
48
|
"default": "./dist/esm/components/*.js"
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
|
+
"./appearance-script": {
|
|
52
|
+
"require": {
|
|
53
|
+
"types": "./dist/cjs/hooks/appearance-script.d.ts",
|
|
54
|
+
"default": "./dist/cjs/hooks/appearance-script.js"
|
|
55
|
+
},
|
|
56
|
+
"import": {
|
|
57
|
+
"types": "./dist/esm/hooks/appearance-script.d.ts",
|
|
58
|
+
"default": "./dist/esm/hooks/appearance-script.js"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
51
61
|
"./helpers": {
|
|
52
62
|
"require": {
|
|
53
63
|
"types": "./dist/cjs/helpers/index.d.ts",
|
|
@@ -176,22 +176,22 @@
|
|
|
176
176
|
@breakpoints {
|
|
177
177
|
.rt-BaseButton {
|
|
178
178
|
&:where(.rt-r-size-1) {
|
|
179
|
-
--base-button-height: var(--
|
|
179
|
+
--base-button-height: var(--control-height-1);
|
|
180
180
|
border-radius: max(var(--radius-1), var(--radius-full));
|
|
181
181
|
}
|
|
182
182
|
|
|
183
183
|
&:where(.rt-r-size-2) {
|
|
184
|
-
--base-button-height: var(--
|
|
184
|
+
--base-button-height: var(--control-height-2);
|
|
185
185
|
border-radius: max(var(--radius-2), var(--radius-full));
|
|
186
186
|
}
|
|
187
187
|
|
|
188
188
|
&:where(.rt-r-size-3) {
|
|
189
|
-
--base-button-height: var(--
|
|
189
|
+
--base-button-height: var(--control-height-3);
|
|
190
190
|
border-radius: max(var(--radius-3), var(--radius-full));
|
|
191
191
|
}
|
|
192
192
|
|
|
193
193
|
&:where(.rt-r-size-4) {
|
|
194
|
-
--base-button-height: var(--
|
|
194
|
+
--base-button-height: var(--control-height-4);
|
|
195
195
|
border-radius: max(var(--radius-4), var(--radius-full));
|
|
196
196
|
}
|
|
197
197
|
}
|
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
--base-menu-item-padding-left-indicator: calc(var(--space-5) / 1.2);
|
|
168
168
|
--base-menu-item-padding-right: var(--space-2);
|
|
169
169
|
--base-menu-item-padding-y: var(--space-1);
|
|
170
|
-
--base-menu-item-height: var(--
|
|
170
|
+
--base-menu-item-height: var(--control-height-1);
|
|
171
171
|
border-radius: var(--radius-surface-3);
|
|
172
172
|
|
|
173
173
|
& :where(.rt-BaseMenuItem) {
|
|
@@ -205,7 +205,7 @@
|
|
|
205
205
|
--base-menu-item-padding-left-indicator: var(--space-5);
|
|
206
206
|
--base-menu-item-padding-right: var(--space-3);
|
|
207
207
|
--base-menu-item-padding-y: var(--space-1);
|
|
208
|
-
--base-menu-item-height: var(--
|
|
208
|
+
--base-menu-item-height: var(--control-height-2);
|
|
209
209
|
border-radius: var(--radius-surface-5);
|
|
210
210
|
|
|
211
211
|
& :where(.rt-BaseMenuItem) {
|
|
@@ -243,7 +243,7 @@
|
|
|
243
243
|
--base-menu-item-padding-left-indicator: var(--space-5);
|
|
244
244
|
--base-menu-item-padding-right: var(--space-3);
|
|
245
245
|
--base-menu-item-padding-y: var(--space-2);
|
|
246
|
-
--base-menu-item-height: var(--
|
|
246
|
+
--base-menu-item-height: var(--control-height-3);
|
|
247
247
|
border-radius: var(--radius-surface-6);
|
|
248
248
|
|
|
249
249
|
& :where(.rt-BaseMenuItem) {
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
font-size: var(--font-size-1);
|
|
84
84
|
line-height: var(--line-height-1);
|
|
85
85
|
letter-spacing: var(--letter-spacing-1);
|
|
86
|
-
--tab-height: var(--
|
|
86
|
+
--tab-height: var(--control-height-1);
|
|
87
87
|
--tab-padding-x: var(--space-1);
|
|
88
88
|
--tab-inner-padding-x: var(--space-1);
|
|
89
89
|
--tab-inner-padding-y: calc(var(--space-1) * var(--spacing-multiplier-small));
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
font-size: var(--font-size-2);
|
|
105
105
|
line-height: var(--line-height-2);
|
|
106
106
|
letter-spacing: var(--letter-spacing-2);
|
|
107
|
-
--tab-height: var(--
|
|
107
|
+
--tab-height: var(--control-height-2);
|
|
108
108
|
--tab-padding-x: var(--space-2);
|
|
109
109
|
--tab-inner-padding-x: var(--space-2);
|
|
110
110
|
--tab-inner-padding-y: var(--space-1);
|
|
@@ -405,7 +405,7 @@
|
|
|
405
405
|
|
|
406
406
|
&:where(.rt-r-size-1) {
|
|
407
407
|
--segmented-control-border-radius: max(var(--radius-1), var(--radius-full));
|
|
408
|
-
--segmented-control-height: var(--
|
|
408
|
+
--segmented-control-height: var(--control-height-1);
|
|
409
409
|
height: var(--segmented-control-height);
|
|
410
410
|
|
|
411
411
|
/* Vertical: height auto, width determined by content or icon-only */
|
|
@@ -436,7 +436,7 @@
|
|
|
436
436
|
}
|
|
437
437
|
&:where(.rt-r-size-2) {
|
|
438
438
|
--segmented-control-border-radius: max(var(--radius-2), var(--radius-full));
|
|
439
|
-
--segmented-control-height: var(--
|
|
439
|
+
--segmented-control-height: var(--control-height-2);
|
|
440
440
|
height: var(--segmented-control-height);
|
|
441
441
|
|
|
442
442
|
/* Vertical: height auto, width determined by content or icon-only */
|
|
@@ -467,7 +467,7 @@
|
|
|
467
467
|
}
|
|
468
468
|
&:where(.rt-r-size-3) {
|
|
469
469
|
--segmented-control-border-radius: max(var(--radius-3), var(--radius-full));
|
|
470
|
-
--segmented-control-height: var(--
|
|
470
|
+
--segmented-control-height: var(--control-height-3);
|
|
471
471
|
height: var(--segmented-control-height);
|
|
472
472
|
|
|
473
473
|
/* Vertical: height auto, width determined by content or icon-only */
|
|
@@ -498,7 +498,7 @@
|
|
|
498
498
|
}
|
|
499
499
|
&:where(.rt-r-size-4) {
|
|
500
500
|
--segmented-control-border-radius: max(var(--radius-4), var(--radius-full));
|
|
501
|
-
--segmented-control-height: var(--
|
|
501
|
+
--segmented-control-height: var(--control-height-4);
|
|
502
502
|
height: var(--segmented-control-height);
|
|
503
503
|
|
|
504
504
|
/* Vertical: height auto, width determined by content or icon-only */
|
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
@breakpoints {
|
|
187
187
|
.rt-SelectTrigger {
|
|
188
188
|
&:where(.rt-r-size-1) {
|
|
189
|
-
--select-trigger-height: var(--
|
|
189
|
+
--select-trigger-height: var(--control-height-1);
|
|
190
190
|
gap: var(--component-gap-1);
|
|
191
191
|
font-size: var(--font-size-1);
|
|
192
192
|
line-height: var(--line-height-1);
|
|
@@ -207,7 +207,7 @@
|
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
&:where(.rt-r-size-2) {
|
|
210
|
-
--select-trigger-height: var(--
|
|
210
|
+
--select-trigger-height: var(--control-height-2);
|
|
211
211
|
gap: var(--component-gap-2);
|
|
212
212
|
font-size: var(--font-size-2);
|
|
213
213
|
line-height: var(--line-height-2);
|
|
@@ -228,7 +228,7 @@
|
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
230
|
&:where(.rt-r-size-3) {
|
|
231
|
-
--select-trigger-height: var(--
|
|
231
|
+
--select-trigger-height: var(--control-height-3);
|
|
232
232
|
gap: var(--component-gap-3);
|
|
233
233
|
font-size: var(--font-size-3);
|
|
234
234
|
line-height: var(--line-height-3);
|
|
@@ -261,7 +261,7 @@
|
|
|
261
261
|
.rt-SelectContent {
|
|
262
262
|
&:where(.rt-r-size-1) {
|
|
263
263
|
--select-content-padding: var(--space-1);
|
|
264
|
-
--select-item-height: var(--
|
|
264
|
+
--select-item-height: var(--control-height-1);
|
|
265
265
|
--select-item-indicator-width: calc(var(--space-5) / var(--select-item-indicator-width-factor));
|
|
266
266
|
--select-separator-margin-right: var(--space-2);
|
|
267
267
|
border-radius: var(--radius-surface-3);
|
|
@@ -284,7 +284,6 @@
|
|
|
284
284
|
}
|
|
285
285
|
&:where(.rt-r-size-2, .rt-r-size-3) {
|
|
286
286
|
--select-content-padding: var(--space-2);
|
|
287
|
-
--select-item-height: var(--space-6);
|
|
288
287
|
--select-item-indicator-width: var(--space-5);
|
|
289
288
|
--select-separator-margin-right: var(--space-3);
|
|
290
289
|
border-radius: var(--radius-surface-4);
|
|
@@ -300,6 +299,8 @@
|
|
|
300
299
|
}
|
|
301
300
|
}
|
|
302
301
|
&:where(.rt-r-size-2) {
|
|
302
|
+
--select-item-height: var(--control-height-2);
|
|
303
|
+
|
|
303
304
|
& :where(.rt-SelectItem) {
|
|
304
305
|
font-size: var(--font-size-2);
|
|
305
306
|
letter-spacing: var(--letter-spacing-2);
|
|
@@ -310,6 +311,8 @@
|
|
|
310
311
|
}
|
|
311
312
|
}
|
|
312
313
|
&:where(.rt-r-size-3) {
|
|
314
|
+
--select-item-height: var(--control-height-3);
|
|
315
|
+
|
|
313
316
|
& :where(.rt-SelectItem) {
|
|
314
317
|
font-size: var(--font-size-3);
|
|
315
318
|
letter-spacing: var(--letter-spacing-3);
|
|
@@ -609,103 +609,50 @@
|
|
|
609
609
|
* *
|
|
610
610
|
***************************************************************************************************/
|
|
611
611
|
|
|
612
|
+
/* A sub-trigger's chevron sits at the row's end; its size comes from the size ladder below */
|
|
613
|
+
.rt-SidebarMenuSubTriggerIcon {
|
|
614
|
+
flex-shrink: 0;
|
|
615
|
+
margin-left: auto;
|
|
616
|
+
}
|
|
617
|
+
|
|
612
618
|
@breakpoints {
|
|
613
|
-
/*
|
|
619
|
+
/* Sidebar rows sit on the control height ladder: size N is as tall as a Button,
|
|
620
|
+
menu item or TextField of size N. Content is a BaseMenuContent, so it takes
|
|
621
|
+
every size value from base-menu.css. Header and Footer are not, so they
|
|
622
|
+
restate base-menu's values here; keep the two in step. */
|
|
614
623
|
.rt-SidebarContainer {
|
|
615
624
|
&:where(.rt-r-size-1) {
|
|
616
625
|
--sidebar-base-padding: var(--space-3);
|
|
617
|
-
--sidebar-item-height: var(--space-6);
|
|
618
|
-
}
|
|
619
|
-
&:where(.rt-r-size-2) {
|
|
620
|
-
--sidebar-base-padding: var(--space-4);
|
|
621
|
-
--sidebar-item-height: var(--space-7);
|
|
622
626
|
}
|
|
623
|
-
&:where(.rt-r-size-3) {
|
|
627
|
+
&:where(.rt-r-size-2, .rt-r-size-3) {
|
|
624
628
|
--sidebar-base-padding: var(--space-4);
|
|
625
|
-
--sidebar-item-height: var(--space-8);
|
|
626
|
-
}
|
|
627
|
-
}
|
|
628
|
-
|
|
629
|
-
/* Content sizing - use base menu tokens directly */
|
|
630
|
-
.rt-SidebarContent {
|
|
631
|
-
&:where(.rt-r-size-1) {
|
|
632
|
-
--sidebar-content-padding: var(--base-menu-content-padding);
|
|
633
|
-
--sidebar-item-padding-left: var(--base-menu-item-padding-left);
|
|
634
|
-
--sidebar-item-padding-right: var(--base-menu-item-padding-right);
|
|
635
|
-
--sidebar-item-padding-y: var(--base-menu-item-padding-y);
|
|
636
|
-
--base-menu-item-height: var(--space-6);
|
|
637
|
-
--sidebar-item-height: var(--base-menu-item-height);
|
|
638
|
-
}
|
|
639
|
-
&:where(.rt-r-size-2) {
|
|
640
|
-
--sidebar-content-padding: var(--base-menu-content-padding);
|
|
641
|
-
--sidebar-item-padding-left: var(--base-menu-item-padding-left);
|
|
642
|
-
--sidebar-item-padding-right: var(--base-menu-item-padding-right);
|
|
643
|
-
--sidebar-item-padding-y: var(--base-menu-item-padding-y);
|
|
644
|
-
--base-menu-item-height: var(--space-7);
|
|
645
|
-
--sidebar-item-height: var(--base-menu-item-height);
|
|
646
|
-
}
|
|
647
|
-
&:where(.rt-r-size-3) {
|
|
648
|
-
--sidebar-content-padding: var(--base-menu-content-padding);
|
|
649
|
-
--sidebar-item-padding-left: var(--base-menu-item-padding-left);
|
|
650
|
-
--sidebar-item-padding-right: var(--base-menu-item-padding-right);
|
|
651
|
-
--sidebar-item-padding-y: var(--base-menu-item-padding-y);
|
|
652
|
-
--base-menu-item-height: var(--space-8);
|
|
653
|
-
--sidebar-item-height: var(--base-menu-item-height);
|
|
654
629
|
}
|
|
655
630
|
}
|
|
656
631
|
|
|
657
|
-
/* Header/Footer sizing - mirror base menu tokens so buttons render correctly */
|
|
658
|
-
.rt-SidebarHeader,
|
|
659
|
-
.rt-SidebarFooter {
|
|
660
|
-
&:where(.rt-r-size-1) {
|
|
661
|
-
--base-menu-content-padding: var(--space-2);
|
|
662
|
-
--base-menu-item-padding-left: calc(var(--space-5) / 1.2);
|
|
663
|
-
--base-menu-item-padding-right: var(--space-2);
|
|
664
|
-
--base-menu-item-padding-y: var(--space-1);
|
|
665
|
-
--base-menu-item-height: var(--space-6);
|
|
666
|
-
--sidebar-item-height: var(--base-menu-item-height);
|
|
667
|
-
}
|
|
668
|
-
|
|
669
|
-
&:where(.rt-r-size-2) {
|
|
670
|
-
--base-menu-content-padding: var(--space-3);
|
|
671
|
-
--base-menu-item-padding-left: var(--space-3);
|
|
672
|
-
--base-menu-item-padding-right: var(--space-3);
|
|
673
|
-
--base-menu-item-padding-y: var(--space-1);
|
|
674
|
-
--base-menu-item-height: var(--space-7);
|
|
675
|
-
--sidebar-item-height: var(--base-menu-item-height);
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
&:where(.rt-r-size-3) {
|
|
679
|
-
--base-menu-content-padding: var(--space-3);
|
|
680
|
-
--base-menu-item-padding-left: var(--space-3);
|
|
681
|
-
--base-menu-item-padding-right: var(--space-3);
|
|
682
|
-
--base-menu-item-padding-y: var(--space-2);
|
|
683
|
-
--base-menu-item-height: var(--space-8);
|
|
684
|
-
--sidebar-item-height: var(--base-menu-item-height);
|
|
685
|
-
}
|
|
686
|
-
}
|
|
687
|
-
|
|
688
|
-
/* Size-specific menu button styling - inherit from base menu */
|
|
689
|
-
.rt-SidebarContent:where(.rt-r-size-1),
|
|
690
632
|
.rt-SidebarHeader:where(.rt-r-size-1),
|
|
691
633
|
.rt-SidebarFooter:where(.rt-r-size-1) {
|
|
634
|
+
--base-menu-content-padding: var(--space-2);
|
|
635
|
+
--base-menu-item-padding-left: var(--space-2);
|
|
636
|
+
--base-menu-item-padding-right: var(--space-2);
|
|
637
|
+
--base-menu-item-padding-y: var(--space-1);
|
|
638
|
+
--base-menu-item-height: var(--control-height-1);
|
|
639
|
+
--sidebar-item-height: var(--base-menu-item-height);
|
|
640
|
+
|
|
692
641
|
& :where(.rt-SidebarMenuButton) {
|
|
693
642
|
gap: var(--component-gap-2);
|
|
694
643
|
font-size: var(--font-size-1);
|
|
695
644
|
line-height: var(--line-height-1);
|
|
696
645
|
letter-spacing: var(--letter-spacing-1);
|
|
697
646
|
border-radius: var(--radius-1);
|
|
698
|
-
font-weight: var(--font-weight-regular);
|
|
699
647
|
|
|
700
648
|
/* stylelint-disable-next-line selector-max-type */
|
|
701
649
|
& :where(svg) {
|
|
702
|
-
width: var(--content-icon-size-
|
|
703
|
-
height: var(--content-icon-size-
|
|
650
|
+
width: var(--content-icon-size-1);
|
|
651
|
+
height: var(--content-icon-size-1);
|
|
704
652
|
flex-shrink: 0;
|
|
705
653
|
}
|
|
706
654
|
}
|
|
707
655
|
|
|
708
|
-
/* Sub-trigger icon sizing - matches base menu exactly */
|
|
709
656
|
& :where(.rt-BaseMenuSubTriggerIcon) {
|
|
710
657
|
width: var(--indicator-icon-size-1);
|
|
711
658
|
height: var(--indicator-icon-size-1);
|
|
@@ -714,38 +661,30 @@
|
|
|
714
661
|
}
|
|
715
662
|
}
|
|
716
663
|
|
|
717
|
-
.rt-SidebarContent:where(.rt-r-size-2),
|
|
718
664
|
.rt-SidebarHeader:where(.rt-r-size-2),
|
|
719
665
|
.rt-SidebarFooter:where(.rt-r-size-2) {
|
|
666
|
+
--base-menu-content-padding: var(--space-3);
|
|
667
|
+
--base-menu-item-padding-left: var(--space-3);
|
|
668
|
+
--base-menu-item-padding-right: var(--space-3);
|
|
669
|
+
--base-menu-item-padding-y: var(--space-1);
|
|
670
|
+
--base-menu-item-height: var(--control-height-2);
|
|
671
|
+
--sidebar-item-height: var(--base-menu-item-height);
|
|
672
|
+
|
|
720
673
|
& :where(.rt-SidebarMenuButton) {
|
|
721
674
|
gap: var(--component-gap-3);
|
|
722
675
|
font-size: var(--font-size-2);
|
|
723
676
|
line-height: var(--line-height-2);
|
|
724
677
|
letter-spacing: var(--letter-spacing-2);
|
|
725
678
|
border-radius: var(--radius-2);
|
|
726
|
-
font-weight: var(--font-weight-regular);
|
|
727
679
|
|
|
728
680
|
/* stylelint-disable-next-line selector-max-type */
|
|
729
681
|
& :where(svg) {
|
|
730
|
-
width: var(--content-icon-size-
|
|
731
|
-
height: var(--content-icon-size-
|
|
682
|
+
width: var(--content-icon-size-2);
|
|
683
|
+
height: var(--content-icon-size-2);
|
|
732
684
|
flex-shrink: 0;
|
|
733
685
|
}
|
|
734
686
|
}
|
|
735
|
-
/* stylelint-disable-next-line selector-max-specificity */
|
|
736
|
-
.rt-SidebarContent:where(.rt-r-size-3) {
|
|
737
|
-
/* stylelint-disable-next-line selector-max-specificity */
|
|
738
|
-
& :where(.rt-SidebarMenuButton) {
|
|
739
|
-
/* stylelint-disable-next-line selector-max-type, selector-max-specificity */
|
|
740
|
-
& :where(svg) {
|
|
741
|
-
width: var(--content-icon-size-3);
|
|
742
|
-
height: var(--content-icon-size-3);
|
|
743
|
-
flex-shrink: 0;
|
|
744
|
-
}
|
|
745
|
-
}
|
|
746
|
-
}
|
|
747
687
|
|
|
748
|
-
/* Sub-trigger icon sizing - matches base menu exactly */
|
|
749
688
|
& :where(.rt-BaseMenuSubTriggerIcon) {
|
|
750
689
|
width: var(--indicator-icon-size-2);
|
|
751
690
|
height: var(--indicator-icon-size-2);
|
|
@@ -754,16 +693,21 @@
|
|
|
754
693
|
}
|
|
755
694
|
}
|
|
756
695
|
|
|
757
|
-
.rt-SidebarContent:where(.rt-r-size-3),
|
|
758
696
|
.rt-SidebarHeader:where(.rt-r-size-3),
|
|
759
697
|
.rt-SidebarFooter:where(.rt-r-size-3) {
|
|
698
|
+
--base-menu-content-padding: var(--space-3);
|
|
699
|
+
--base-menu-item-padding-left: var(--space-3);
|
|
700
|
+
--base-menu-item-padding-right: var(--space-3);
|
|
701
|
+
--base-menu-item-padding-y: var(--space-2);
|
|
702
|
+
--base-menu-item-height: var(--control-height-3);
|
|
703
|
+
--sidebar-item-height: var(--base-menu-item-height);
|
|
704
|
+
|
|
760
705
|
& :where(.rt-SidebarMenuButton) {
|
|
761
|
-
gap: var(--component-gap-
|
|
706
|
+
gap: var(--component-gap-4);
|
|
762
707
|
font-size: var(--font-size-3);
|
|
763
|
-
line-height: var(--line-height-
|
|
764
|
-
letter-spacing: var(--letter-spacing-
|
|
708
|
+
line-height: var(--line-height-3);
|
|
709
|
+
letter-spacing: var(--letter-spacing-3);
|
|
765
710
|
border-radius: var(--radius-2);
|
|
766
|
-
font-weight: var(--font-weight-regular);
|
|
767
711
|
|
|
768
712
|
/* stylelint-disable-next-line selector-max-type */
|
|
769
713
|
& :where(svg) {
|
|
@@ -774,8 +718,8 @@
|
|
|
774
718
|
}
|
|
775
719
|
|
|
776
720
|
& :where(.rt-BaseMenuSubTriggerIcon) {
|
|
777
|
-
width: var(--indicator-icon-size-
|
|
778
|
-
height: var(--indicator-icon-size-
|
|
721
|
+
width: var(--indicator-icon-size-3);
|
|
722
|
+
height: var(--indicator-icon-size-3);
|
|
779
723
|
flex-shrink: 0;
|
|
780
724
|
margin-left: auto;
|
|
781
725
|
}
|