@askrjs/themes 0.0.4 → 0.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/components/_internal/box-layout.js.map +1 -1
- package/dist/components/_internal/classes.js.map +1 -1
- package/dist/components/_internal/jsx.js.map +1 -1
- package/dist/components/_internal/layout.js +2 -1
- package/dist/components/_internal/layout.js.map +1 -1
- package/dist/components/_internal/merge-props.js.map +1 -1
- package/dist/components/_internal/pathname.js.map +1 -1
- package/dist/components/_internal/style.js.map +1 -1
- package/dist/components/alert/alert.js.map +1 -1
- package/dist/components/aspect-ratio/aspect-ratio.js.map +1 -1
- package/dist/components/badge/badge.js.map +1 -1
- package/dist/components/block/block.js.map +1 -1
- package/dist/components/box/box.js.map +1 -1
- package/dist/components/breadcrumb/breadcrumb.a11y.js.map +1 -1
- package/dist/components/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/components/button-group/button-group.js.map +1 -1
- package/dist/components/card/card.js.map +1 -1
- package/dist/components/close/close.js.map +1 -1
- package/dist/components/container/container.a11y.d.ts +0 -1
- package/dist/components/container/container.js +7 -7
- package/dist/components/container/container.js.map +1 -1
- package/dist/components/container/container.types.d.ts +2 -3
- package/dist/components/empty-state/empty-state.js.map +1 -1
- package/dist/components/field/field.js.map +1 -1
- package/dist/components/flex/flex.js.map +1 -1
- package/dist/components/header/header.a11y.js.map +1 -1
- package/dist/components/header/header.js.map +1 -1
- package/dist/components/inline/index.js.map +1 -1
- package/dist/components/input-group/input-group.js.map +1 -1
- package/dist/components/list-group/list-group.js.map +1 -1
- package/dist/components/nav/nav.js.map +1 -1
- package/dist/components/navbar/navbar-panel.js.map +1 -1
- package/dist/components/navbar/navbar.context.js.map +1 -1
- package/dist/components/navbar/navbar.js.map +1 -1
- package/dist/components/navbar/navbar.render.js.map +1 -1
- package/dist/components/navbar/navbar.shared.js.map +1 -1
- package/dist/components/overlays/dropdown-content.js.map +1 -1
- package/dist/components/pagination/pagination.js.map +1 -1
- package/dist/components/section/section.js.map +1 -1
- package/dist/components/separator/separator.a11y.js.map +1 -1
- package/dist/components/separator/separator.js.map +1 -1
- package/dist/components/shell/shell-panel.js.map +1 -1
- package/dist/components/shell/shell-responsive.js.map +1 -1
- package/dist/components/shell/shell.a11y.js.map +1 -1
- package/dist/components/shell/shell.js.map +1 -1
- package/dist/components/sidebar/sidebar-panel.js.map +1 -1
- package/dist/components/sidebar/sidebar-toggle.js.map +1 -1
- package/dist/components/sidebar/sidebar.context.js.map +1 -1
- package/dist/components/sidebar/sidebar.js.map +1 -1
- package/dist/components/sidebar/sidebar.shared.js.map +1 -1
- package/dist/components/skeleton/skeleton.js.map +1 -1
- package/dist/components/spacer/spacer.js.map +1 -1
- package/dist/components/spinner/spinner.js.map +1 -1
- package/dist/components/stack/stack.js.map +1 -1
- package/dist/components/theme/theme.js +13 -3
- package/dist/components/theme/theme.js.map +1 -1
- package/dist/controls.d.ts +1 -1
- package/dist/feedback.d.ts +1 -1
- package/dist/layouts.d.ts +1 -1
- package/dist/navs.d.ts +1 -1
- package/dist/shells.d.ts +1 -1
- package/dist/surfaces.d.ts +1 -1
- package/dist/themes/default/index.css +220 -141
- package/package.json +11 -10
- package/src/components/_internal/layout.ts +1 -0
- package/src/components/container/container.a11y.ts +0 -1
- package/src/components/container/container.tsx +9 -19
- package/src/components/container/container.types.ts +1 -3
- package/src/components/theme/theme.tsx +22 -1
- package/src/themes/default/index.css +1 -1
- package/src/themes/default/styles/base/utilities.css +34 -5
- package/src/themes/default/styles/display/coverage.css +91 -1
- package/src/themes/default/styles/layout/layout.css +1 -1
- package/src/themes/default/styles/layout/responsive-layout.css +3 -1
- package/src/themes/default/styles/shell/sidebar.css +22 -1
- package/templates/theme/index.css +1 -1
- package/templates/theme/styles/display/coverage.css +91 -1
- package/templates/theme/styles/layout/responsive-layout.css +3 -1
|
@@ -124,12 +124,12 @@ function ThemeToggle(props) {
|
|
|
124
124
|
nextTheme
|
|
125
125
|
};
|
|
126
126
|
const ariaLabel = rest["aria-label"];
|
|
127
|
-
const
|
|
127
|
+
const renderedIcon = cloneThemeToggleIcon(resolveThemeToggleIcon(currentTheme, nextTheme, {
|
|
128
128
|
lightIcon,
|
|
129
129
|
darkIcon,
|
|
130
130
|
systemIcon
|
|
131
|
-
});
|
|
132
|
-
const content = typeof children === "function" ? children(renderContext) : children ??
|
|
131
|
+
}));
|
|
132
|
+
const content = typeof children === "function" ? children(renderContext) : children ?? renderedIcon;
|
|
133
133
|
return /* @__PURE__ */ jsx(Button, {
|
|
134
134
|
...rest,
|
|
135
135
|
"aria-label": typeof ariaLabel === "string" ? ariaLabel : `Switch to ${nextTheme} theme`,
|
|
@@ -156,6 +156,16 @@ function getThemeIcon(theme, icons) {
|
|
|
156
156
|
function resolveThemeToggleIcon(theme, nextTheme, icons) {
|
|
157
157
|
return getThemeIcon(theme, icons) ?? getThemeIcon(nextTheme, icons);
|
|
158
158
|
}
|
|
159
|
+
function isJSXElement(value) {
|
|
160
|
+
return typeof value === "object" && value !== null && "$$typeof" in value && "type" in value && "props" in value;
|
|
161
|
+
}
|
|
162
|
+
function cloneThemeToggleIcon(icon) {
|
|
163
|
+
if (!isJSXElement(icon)) return icon;
|
|
164
|
+
return {
|
|
165
|
+
...icon,
|
|
166
|
+
props: { ...icon.props }
|
|
167
|
+
};
|
|
168
|
+
}
|
|
159
169
|
function syncThemeRoot(themeChoice) {
|
|
160
170
|
if (typeof document === "undefined") return;
|
|
161
171
|
const html = document.documentElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.js","names":[],"sources":["../../../src/components/theme/theme.tsx"],"sourcesContent":["import { defineContext, readContext, state } from \"@askrjs/askr\";\nimport { resource } from \"@askrjs/askr/resources\";\nimport { Button } from \"@askrjs/ui\";\nimport type { ButtonNativeProps, PressEvent } from \"@askrjs/ui\";\n\nexport const CAT_THEME_NAMES = [\"tabby\", \"ginger\", \"tuxedo\", \"calico\", \"torty\"] as const;\n\nexport type CatThemeName = (typeof CAT_THEME_NAMES)[number];\nexport type ThemeName = \"light\" | \"dark\" | \"system\" | CatThemeName | (string & {});\n\nexport type ThemeOption = {\n value: ThemeName;\n label: string;\n};\n\nexport type ThemeContextValue = {\n theme: () => ThemeName;\n setTheme: (theme: ThemeName) => void;\n themes: readonly ThemeOption[];\n storageKey: string;\n};\n\nexport type ThemeProviderProps = {\n children?: unknown;\n defaultTheme?: ThemeName;\n themes?: readonly ThemeOption[];\n storageKey?: string;\n};\n\nexport type ThemePickerProps = Omit<\n JSX.IntrinsicElements[\"select\"],\n \"children\" | \"value\" | \"defaultValue\" | \"onChange\"\n> & {\n themes?: readonly ThemeOption[];\n label?: string;\n};\n\nexport type ThemeToggleRenderContext = {\n theme: ThemeName;\n nextTheme: ThemeName;\n};\n\nexport type ThemeToggleProps = Omit<ButtonNativeProps, \"children\" | \"onPress\"> & {\n children?: unknown | ((context: ThemeToggleRenderContext) => unknown);\n lightIcon?: unknown;\n darkIcon?: unknown;\n systemIcon?: unknown;\n themes?: readonly ThemeName[];\n onPress?: (event: PressEvent) => void;\n};\n\nexport const DEFAULT_THEME_OPTIONS: readonly ThemeOption[] = [\n { value: \"system\", label: \"System\" },\n { value: \"light\", label: \"Light\" },\n { value: \"dark\", label: \"Dark\" },\n];\n\nexport const CAT_THEME_OPTIONS: readonly ThemeOption[] = [\n { value: \"tabby\", label: \"Tabby\" },\n { value: \"ginger\", label: \"Ginger\" },\n { value: \"tuxedo\", label: \"Tuxedo\" },\n { value: \"calico\", label: \"Calico\" },\n { value: \"torty\", label: \"Torty\" },\n];\n\nconst DEFAULT_STORAGE_KEY = \"askr-theme\";\n\nconst ThemeContext = defineContext<ThemeContextValue>({\n theme: () => \"system\",\n setTheme: () => undefined,\n themes: DEFAULT_THEME_OPTIONS,\n storageKey: DEFAULT_STORAGE_KEY,\n});\n\nexport function useTheme(): ThemeContextValue {\n return readContext(ThemeContext);\n}\n\nexport function ThemeProvider(props: ThemeProviderProps): JSX.Element {\n const {\n children,\n defaultTheme = \"system\",\n themes = DEFAULT_THEME_OPTIONS,\n storageKey = DEFAULT_STORAGE_KEY,\n } = props;\n\n const themeState = state<ThemeName>(readStoredTheme(storageKey) ?? defaultTheme);\n\n const setTheme = (nextTheme: ThemeName) => {\n themeState.set(nextTheme);\n writeStoredTheme(storageKey, nextTheme);\n syncThemeRoot(nextTheme);\n };\n\n const value: ThemeContextValue = {\n theme: themeState,\n setTheme,\n themes,\n storageKey,\n };\n\n const currentTheme = themeState();\n\n return (\n <ThemeContext.Scope value={value}>\n <ThemeRootSync theme={currentTheme} />\n <div data-slot=\"theme-provider\">{children}</div>\n </ThemeContext.Scope>\n );\n}\n\nfunction ThemeRootSync(props: { theme: ThemeName }): JSX.Element | null {\n const { theme } = props;\n\n resource(\n ({ signal }: { signal: AbortSignal }) => {\n if (typeof window === \"undefined\") {\n syncThemeRoot(theme);\n return null;\n }\n\n const timeoutId = window.setTimeout(() => {\n if (!signal.aborted) {\n syncThemeRoot(theme);\n }\n }, 0);\n\n signal.addEventListener(\n \"abort\",\n () => {\n window.clearTimeout(timeoutId);\n },\n { once: true },\n );\n\n return null;\n },\n [theme],\n );\n\n return null;\n}\n\nexport function ThemePicker(props: ThemePickerProps): JSX.Element {\n const theme = useTheme();\n const { themes = theme.themes, label = \"Theme\", ...rest } = props;\n\n return (\n <select\n {...rest}\n aria-label={rest[\"aria-label\"] ?? label}\n data-slot=\"theme-picker\"\n value={theme.theme()}\n onChange={(event: Event) => {\n const target = event.currentTarget as HTMLSelectElement;\n theme.setTheme(target.value as ThemeName);\n }}\n >\n {themes.map((option) => (\n <option key={option.value} value={option.value}>\n {option.label}\n </option>\n ))}\n </select>\n );\n}\n\nexport function ThemeToggle(props: ThemeToggleProps): JSX.Element {\n const theme = useTheme();\n const {\n children,\n lightIcon,\n darkIcon,\n systemIcon,\n themes = [\"light\", \"dark\"],\n onPress,\n ...rest\n } = props;\n\n const currentTheme = theme.theme();\n const nextTheme = getNextTheme(currentTheme, themes);\n const renderContext = { theme: currentTheme, nextTheme };\n const ariaLabel = (rest as Record<string, unknown>)[\"aria-label\"];\n const themedIcon = resolveThemeToggleIcon(currentTheme, nextTheme, {\n lightIcon,\n darkIcon,\n systemIcon,\n });\n const content =\n typeof children === \"function\" ? children(renderContext) : (children ?? themedIcon);\n\n return (\n <Button\n {...(rest as ButtonNativeProps)}\n aria-label={typeof ariaLabel === \"string\" ? ariaLabel : `Switch to ${nextTheme} theme`}\n data-theme-control=\"toggle\"\n data-theme-choice={currentTheme}\n data-next-theme={nextTheme}\n onPress={(event) => {\n onPress?.(event);\n if (!event.defaultPrevented) theme.setTheme(nextTheme);\n }}\n >\n {content}\n </Button>\n );\n}\n\nfunction getNextTheme(currentTheme: ThemeName, themes: readonly ThemeName[]): ThemeName {\n if (themes.length === 0) return currentTheme;\n const index = themes.indexOf(currentTheme);\n return themes[index >= 0 && index < themes.length - 1 ? index + 1 : 0]!;\n}\n\nfunction getThemeIcon(\n theme: ThemeName,\n icons: Pick<ThemeToggleProps, \"lightIcon\" | \"darkIcon\" | \"systemIcon\">,\n): unknown {\n if (theme === \"light\") return icons.lightIcon;\n if (theme === \"dark\") return icons.darkIcon;\n if (theme === \"system\") return icons.systemIcon;\n return undefined;\n}\n\nexport function resolveThemeToggleIcon(\n theme: ThemeName,\n nextTheme: ThemeName,\n icons: Pick<ThemeToggleProps, \"lightIcon\" | \"darkIcon\" | \"systemIcon\">,\n): unknown {\n return getThemeIcon(theme, icons) ?? getThemeIcon(nextTheme, icons);\n}\n\nfunction syncThemeRoot(themeChoice: ThemeName | null | undefined): void {\n if (typeof document === \"undefined\") {\n return;\n }\n\n const html = document.documentElement;\n\n if (themeChoice == null) {\n html.removeAttribute(\"data-theme\");\n html.removeAttribute(\"data-theme-choice\");\n return;\n }\n\n html.setAttribute(\"data-theme-choice\", themeChoice);\n\n if (themeChoice === \"system\") {\n html.removeAttribute(\"data-theme\");\n } else {\n html.setAttribute(\"data-theme\", themeChoice);\n }\n}\n\nfunction readStoredTheme(storageKey: string): ThemeName | undefined {\n if (typeof window === \"undefined\") return undefined;\n try {\n return (window.localStorage.getItem(storageKey) as ThemeName | null) ?? undefined;\n } catch {\n return undefined;\n }\n}\n\nfunction writeStoredTheme(storageKey: string, theme: ThemeName): void {\n if (typeof window === \"undefined\") return;\n try {\n window.localStorage.setItem(storageKey, theme);\n } catch {\n // Storage can be unavailable in private or locked-down browser contexts.\n }\n}\n"],"mappings":";;;;;AAKA,MAAa,kBAAkB;CAAC;CAAS;CAAU;CAAU;CAAU;CAAQ;AA8C/E,MAAa,wBAAgD;CAC3D;EAAE,OAAO;EAAU,OAAO;EAAU;CACpC;EAAE,OAAO;EAAS,OAAO;EAAS;CAClC;EAAE,OAAO;EAAQ,OAAO;EAAQ;CACjC;AAED,MAAa,oBAA4C;CACvD;EAAE,OAAO;EAAS,OAAO;EAAS;CAClC;EAAE,OAAO;EAAU,OAAO;EAAU;CACpC;EAAE,OAAO;EAAU,OAAO;EAAU;CACpC;EAAE,OAAO;EAAU,OAAO;EAAU;CACpC;EAAE,OAAO;EAAS,OAAO;EAAS;CACnC;AAED,MAAM,sBAAsB;AAE5B,MAAM,eAAe,cAAiC;CACpD,aAAa;CACb,gBAAgB,KAAA;CAChB,QAAQ;CACR,YAAY;CACb,CAAC;AAEF,SAAgB,WAA8B;CAC5C,OAAO,YAAY,aAAa;;AAGlC,SAAgB,cAAc,OAAwC;CACpE,MAAM,EACJ,UACA,eAAe,UACf,SAAS,uBACT,aAAa,wBACX;CAEJ,MAAM,aAAa,MAAiB,gBAAgB,WAAW,IAAI,aAAa;CAEhF,MAAM,YAAY,cAAyB;EACzC,WAAW,IAAI,UAAU;EACzB,iBAAiB,YAAY,UAAU;EACvC,cAAc,UAAU;;CAG1B,MAAM,QAA2B;EAC/B,OAAO;EACP;EACA;EACA;EACD;CAED,MAAM,eAAe,YAAY;CAEjC,OACE,qBAAC,aAAa,OAAd;EAA2B;YAA3B,CACE,oBAAC,eAAD,EAAe,OAAO,cAA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esContent":["import { defineContext, readContext, state } from \"@askrjs/askr\";\nimport type { JSXElement } from \"@askrjs/askr/foundations/structures\";\nimport { resource } from \"@askrjs/askr/resources\";\nimport { Button } from \"@askrjs/ui\";\nimport type { ButtonNativeProps, PressEvent } from \"@askrjs/ui\";\n\nexport const CAT_THEME_NAMES = [\"tabby\", \"ginger\", \"tuxedo\", \"calico\", \"torty\"] as const;\n\nexport type CatThemeName = (typeof CAT_THEME_NAMES)[number];\nexport type ThemeName = \"light\" | \"dark\" | \"system\" | CatThemeName | (string & {});\n\nexport type ThemeOption = {\n value: ThemeName;\n label: string;\n};\n\nexport type ThemeContextValue = {\n theme: () => ThemeName;\n setTheme: (theme: ThemeName) => void;\n themes: readonly ThemeOption[];\n storageKey: string;\n};\n\nexport type ThemeProviderProps = {\n children?: unknown;\n defaultTheme?: ThemeName;\n themes?: readonly ThemeOption[];\n storageKey?: string;\n};\n\nexport type ThemePickerProps = Omit<\n JSX.IntrinsicElements[\"select\"],\n \"children\" | \"value\" | \"defaultValue\" | \"onChange\"\n> & {\n themes?: readonly ThemeOption[];\n label?: string;\n};\n\nexport type ThemeToggleRenderContext = {\n theme: ThemeName;\n nextTheme: ThemeName;\n};\n\nexport type ThemeToggleProps = Omit<ButtonNativeProps, \"children\" | \"onPress\"> & {\n children?: unknown | ((context: ThemeToggleRenderContext) => unknown);\n lightIcon?: unknown;\n darkIcon?: unknown;\n systemIcon?: unknown;\n themes?: readonly ThemeName[];\n onPress?: (event: PressEvent) => void;\n};\n\nexport const DEFAULT_THEME_OPTIONS: readonly ThemeOption[] = [\n { value: \"system\", label: \"System\" },\n { value: \"light\", label: \"Light\" },\n { value: \"dark\", label: \"Dark\" },\n];\n\nexport const CAT_THEME_OPTIONS: readonly ThemeOption[] = [\n { value: \"tabby\", label: \"Tabby\" },\n { value: \"ginger\", label: \"Ginger\" },\n { value: \"tuxedo\", label: \"Tuxedo\" },\n { value: \"calico\", label: \"Calico\" },\n { value: \"torty\", label: \"Torty\" },\n];\n\nconst DEFAULT_STORAGE_KEY = \"askr-theme\";\n\nconst ThemeContext = defineContext<ThemeContextValue>({\n theme: () => \"system\",\n setTheme: () => undefined,\n themes: DEFAULT_THEME_OPTIONS,\n storageKey: DEFAULT_STORAGE_KEY,\n});\n\nexport function useTheme(): ThemeContextValue {\n return readContext(ThemeContext);\n}\n\nexport function ThemeProvider(props: ThemeProviderProps): JSX.Element {\n const {\n children,\n defaultTheme = \"system\",\n themes = DEFAULT_THEME_OPTIONS,\n storageKey = DEFAULT_STORAGE_KEY,\n } = props;\n\n const themeState = state<ThemeName>(readStoredTheme(storageKey) ?? defaultTheme);\n\n const setTheme = (nextTheme: ThemeName) => {\n themeState.set(nextTheme);\n writeStoredTheme(storageKey, nextTheme);\n syncThemeRoot(nextTheme);\n };\n\n const value: ThemeContextValue = {\n theme: themeState,\n setTheme,\n themes,\n storageKey,\n };\n\n const currentTheme = themeState();\n\n return (\n <ThemeContext.Scope value={value}>\n <ThemeRootSync theme={currentTheme} />\n <div data-slot=\"theme-provider\">{children}</div>\n </ThemeContext.Scope>\n );\n}\n\nfunction ThemeRootSync(props: { theme: ThemeName }): JSX.Element | null {\n const { theme } = props;\n\n resource(\n ({ signal }: { signal: AbortSignal }) => {\n if (typeof window === \"undefined\") {\n syncThemeRoot(theme);\n return null;\n }\n\n const timeoutId = window.setTimeout(() => {\n if (!signal.aborted) {\n syncThemeRoot(theme);\n }\n }, 0);\n\n signal.addEventListener(\n \"abort\",\n () => {\n window.clearTimeout(timeoutId);\n },\n { once: true },\n );\n\n return null;\n },\n [theme],\n );\n\n return null;\n}\n\nexport function ThemePicker(props: ThemePickerProps): JSX.Element {\n const theme = useTheme();\n const { themes = theme.themes, label = \"Theme\", ...rest } = props;\n\n return (\n <select\n {...rest}\n aria-label={rest[\"aria-label\"] ?? label}\n data-slot=\"theme-picker\"\n value={theme.theme()}\n onChange={(event: Event) => {\n const target = event.currentTarget as HTMLSelectElement;\n theme.setTheme(target.value as ThemeName);\n }}\n >\n {themes.map((option) => (\n <option key={option.value} value={option.value}>\n {option.label}\n </option>\n ))}\n </select>\n );\n}\n\nexport function ThemeToggle(props: ThemeToggleProps): JSX.Element {\n const theme = useTheme();\n const {\n children,\n lightIcon,\n darkIcon,\n systemIcon,\n themes = [\"light\", \"dark\"],\n onPress,\n ...rest\n } = props;\n\n const currentTheme = theme.theme();\n const nextTheme = getNextTheme(currentTheme, themes);\n const renderContext = { theme: currentTheme, nextTheme };\n const ariaLabel = (rest as Record<string, unknown>)[\"aria-label\"];\n const themedIcon = resolveThemeToggleIcon(currentTheme, nextTheme, {\n lightIcon,\n darkIcon,\n systemIcon,\n });\n const renderedIcon = cloneThemeToggleIcon(themedIcon);\n const content =\n typeof children === \"function\" ? children(renderContext) : (children ?? renderedIcon);\n\n return (\n <Button\n {...(rest as ButtonNativeProps)}\n aria-label={typeof ariaLabel === \"string\" ? ariaLabel : `Switch to ${nextTheme} theme`}\n data-theme-control=\"toggle\"\n data-theme-choice={currentTheme}\n data-next-theme={nextTheme}\n onPress={(event) => {\n onPress?.(event);\n if (!event.defaultPrevented) theme.setTheme(nextTheme);\n }}\n >\n {content}\n </Button>\n );\n}\n\nfunction getNextTheme(currentTheme: ThemeName, themes: readonly ThemeName[]): ThemeName {\n if (themes.length === 0) return currentTheme;\n const index = themes.indexOf(currentTheme);\n return themes[index >= 0 && index < themes.length - 1 ? index + 1 : 0]!;\n}\n\nfunction getThemeIcon(\n theme: ThemeName,\n icons: Pick<ThemeToggleProps, \"lightIcon\" | \"darkIcon\" | \"systemIcon\">,\n): unknown {\n if (theme === \"light\") return icons.lightIcon;\n if (theme === \"dark\") return icons.darkIcon;\n if (theme === \"system\") return icons.systemIcon;\n return undefined;\n}\n\nexport function resolveThemeToggleIcon(\n theme: ThemeName,\n nextTheme: ThemeName,\n icons: Pick<ThemeToggleProps, \"lightIcon\" | \"darkIcon\" | \"systemIcon\">,\n): unknown {\n return getThemeIcon(theme, icons) ?? getThemeIcon(nextTheme, icons);\n}\n\nfunction isJSXElement(value: unknown): value is JSXElement {\n return (\n typeof value === \"object\" &&\n value !== null &&\n \"$$typeof\" in value &&\n \"type\" in value &&\n \"props\" in value\n );\n}\n\nfunction cloneThemeToggleIcon(icon: unknown): unknown {\n if (!isJSXElement(icon)) return icon;\n\n return {\n ...icon,\n props: { ...(icon.props as Record<string, unknown> | undefined) },\n };\n}\n\nfunction syncThemeRoot(themeChoice: ThemeName | null | undefined): void {\n if (typeof document === \"undefined\") {\n return;\n }\n\n const html = document.documentElement;\n\n if (themeChoice == null) {\n html.removeAttribute(\"data-theme\");\n html.removeAttribute(\"data-theme-choice\");\n return;\n }\n\n html.setAttribute(\"data-theme-choice\", themeChoice);\n\n if (themeChoice === \"system\") {\n html.removeAttribute(\"data-theme\");\n } else {\n html.setAttribute(\"data-theme\", themeChoice);\n }\n}\n\nfunction readStoredTheme(storageKey: string): ThemeName | undefined {\n if (typeof window === \"undefined\") return undefined;\n try {\n return (window.localStorage.getItem(storageKey) as ThemeName | null) ?? undefined;\n } catch {\n return undefined;\n }\n}\n\nfunction writeStoredTheme(storageKey: string, theme: ThemeName): void {\n if (typeof window === \"undefined\") return;\n try {\n window.localStorage.setItem(storageKey, theme);\n } catch {\n // Storage can be unavailable in private or locked-down browser contexts.\n }\n}\n"],"mappings":";;;;;AAMA,MAAa,kBAAkB;CAAC;CAAS;CAAU;CAAU;CAAU;AAAO;AA8C9E,MAAa,wBAAgD;CAC3D;EAAE,OAAO;EAAU,OAAO;CAAS;CACnC;EAAE,OAAO;EAAS,OAAO;CAAQ;CACjC;EAAE,OAAO;EAAQ,OAAO;CAAO;AACjC;AAEA,MAAa,oBAA4C;CACvD;EAAE,OAAO;EAAS,OAAO;CAAQ;CACjC;EAAE,OAAO;EAAU,OAAO;CAAS;CACnC;EAAE,OAAO;EAAU,OAAO;CAAS;CACnC;EAAE,OAAO;EAAU,OAAO;CAAS;CACnC;EAAE,OAAO;EAAS,OAAO;CAAQ;AACnC;AAEA,MAAM,sBAAsB;A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AAS,aAAa,OAAqC;CACzD,OACE,OAAO,UAAU,YACjB,UAAU,QACV,cAAc,SACd,UAAU,SACV,WAAW;AAEf;AAEA,SAAS,qBAAqB,MAAwB;CACpD,IAAI,CAAC,aAAa,IAAI,GAAG,OAAO;CAEhC,OAAO;EACL,GAAG;EACH,OAAO,EAAE,GAAI,KAAK,MAA8C;CAClE;AACF;AAEA,SAAS,cAAc,aAAiD;CACtE,IAAI,OAAO,aAAa,aACtB;CAGF,MAAM,OAAO,SAAS;CAEtB,IAAI,eAAe,MAAM;EACvB,KAAK,gBAAgB,YAAY;EACjC,KAAK,gBAAgB,mBAAmB;EACxC;CACF;CAEA,KAAK,aAAa,qBAAqB,WAAW;CAElD,IAAI,gBAAgB,UAClB,KAAK,gBAAgB,YAAY;MAEjC,KAAK,aAAa,cAAc,WAAW;AAE/C;AAEA,SAAS,gBAAgB,YAA2C;CAClE,IAAI,OAAO,WAAW,aAAa,OAAO,KAAA;CAC1C,IAAI;EACF,OAAQ,OAAO,aAAa,QAAQ,UAAU,KAA0B,KAAA;CAC1E,QAAQ;EACN;CACF;AACF;AAEA,SAAS,iBAAiB,YAAoB,OAAwB;CACpE,IAAI,OAAO,WAAW,aAAa;CACnC,IAAI;EACF,OAAO,aAAa,QAAQ,YAAY,KAAK;CAC/C,QAAQ,CAER;AACF"}
|
package/dist/controls.d.ts
CHANGED
|
@@ -7,4 +7,4 @@ import { Field, FieldError, FieldHint } from "./components/field/field.js";
|
|
|
7
7
|
import { InputGroupOrientation, InputGroupProps, InputGroupTextAsChildProps, InputGroupTextProps } from "./components/input-group/input-group.types.js";
|
|
8
8
|
import { InputGroup, InputGroupText } from "./components/input-group/input-group.js";
|
|
9
9
|
import { Button, ButtonAsChildProps, ButtonNativeProps, ButtonOwnProps, ButtonProps } from "@askrjs/ui";
|
|
10
|
-
export { Button, type ButtonAsChildProps, ButtonGroup, ButtonGroupOrientation, ButtonGroupProps, type ButtonNativeProps, type ButtonOwnProps, type ButtonProps, Close, CloseNativeProps, CloseOwnProps, Field, FieldError, FieldErrorProps, FieldHint, FieldHintProps, FieldProps, InputGroup, InputGroupOrientation, InputGroupProps, InputGroupText, InputGroupTextAsChildProps, InputGroupTextProps };
|
|
10
|
+
export { Button, type ButtonAsChildProps, ButtonGroup, type ButtonGroupOrientation, type ButtonGroupProps, type ButtonNativeProps, type ButtonOwnProps, type ButtonProps, Close, type CloseNativeProps, type CloseOwnProps, Field, FieldError, type FieldErrorProps, FieldHint, type FieldHintProps, type FieldProps, InputGroup, type InputGroupOrientation, type InputGroupProps, InputGroupText, type InputGroupTextAsChildProps, type InputGroupTextProps };
|
package/dist/feedback.d.ts
CHANGED
|
@@ -2,4 +2,4 @@ import { EmptyStateHeadingTag, EmptyStateProps } from "./components/empty-state/
|
|
|
2
2
|
import { EmptyState } from "./components/empty-state/empty-state.js";
|
|
3
3
|
import { SpinnerOwnProps, SpinnerProps } from "./components/spinner/spinner.types.js";
|
|
4
4
|
import { Spinner } from "./components/spinner/spinner.js";
|
|
5
|
-
export { EmptyState, EmptyStateHeadingTag, EmptyStateProps, Spinner, SpinnerOwnProps, SpinnerProps };
|
|
5
|
+
export { EmptyState, type EmptyStateHeadingTag, type EmptyStateProps, Spinner, type SpinnerOwnProps, type SpinnerProps };
|
package/dist/layouts.d.ts
CHANGED
|
@@ -22,4 +22,4 @@ import { SPACER_A11Y_CONTRACT, SpacerA11yContract } from "./components/spacer/sp
|
|
|
22
22
|
import { StackAsChildProps, StackDivProps, StackOwnProps, StackProps } from "./components/stack/stack.types.js";
|
|
23
23
|
import { Stack } from "./components/stack/stack.js";
|
|
24
24
|
import { STACK_A11Y_CONTRACT, StackA11yContract } from "./components/stack/stack.a11y.js";
|
|
25
|
-
export { AspectRatio, AspectRatioAsChildProps, AspectRatioProps, BLOCK_A11Y_CONTRACT, BOX_A11Y_CONTRACT, Block, BlockA11yContract, BlockAsChildProps, BlockDivProps, BlockNativeProps, BlockOwnProps, BlockProps, BlockSize, BlockSpanProps, Box, BoxA11yContract, BoxAsChildProps, BoxDivProps, BoxLayoutOwnProps, BoxOwnProps, BoxProps, BoxSpanProps, CONTAINER_A11Y_CONTRACT, Container, ContainerA11yContract, ContainerAsChildProps, ContainerNativeProps, ContainerOwnProps, ContainerProps, ContainerVariant, FLEX_A11Y_CONTRACT, Flex, FlexA11yContract, FlexAsChildProps, FlexDivProps, FlexNativeProps, FlexOwnProps, FlexProps, FlexSpanProps, FLEX_A11Y_CONTRACT as INLINE_A11Y_CONTRACT, Inline, FlexA11yContract as InlineA11yContract, FlexAsChildProps as InlineAsChildProps, FlexDivProps as InlineDivProps, FlexNativeProps as InlineNativeProps, FlexOwnProps as InlineOwnProps, FlexProps as InlineProps, FlexSpanProps as InlineSpanProps, LayoutResponsive, SECTION_A11Y_CONTRACT, SPACER_A11Y_CONTRACT, STACK_A11Y_CONTRACT, Section, SectionA11yContract, SectionAsChildProps, SectionElementProps, SectionOwnProps, SectionProps, Spacer, SpacerA11yContract, SpacerAsChildProps, SpacerAxis, SpacerNativeProps, SpacerOwnProps, SpacerProps, Stack, StackA11yContract, StackAsChildProps, StackDivProps, StackOwnProps, StackProps };
|
|
25
|
+
export { AspectRatio, type AspectRatioAsChildProps, type AspectRatioProps, type BLOCK_A11Y_CONTRACT, type BOX_A11Y_CONTRACT, Block, type BlockA11yContract, type BlockAsChildProps, type BlockDivProps, type BlockNativeProps, type BlockOwnProps, type BlockProps, type BlockSize, type BlockSpanProps, Box, type BoxA11yContract, type BoxAsChildProps, type BoxDivProps, type BoxLayoutOwnProps, type BoxOwnProps, type BoxProps, type BoxSpanProps, type CONTAINER_A11Y_CONTRACT, Container, type ContainerA11yContract, type ContainerAsChildProps, type ContainerNativeProps, type ContainerOwnProps, type ContainerProps, type ContainerVariant, type FLEX_A11Y_CONTRACT, Flex, type FlexA11yContract, type FlexAsChildProps, type FlexDivProps, type FlexNativeProps, type FlexOwnProps, type FlexProps, type FlexSpanProps, type FLEX_A11Y_CONTRACT as INLINE_A11Y_CONTRACT, Inline, type FlexA11yContract as InlineA11yContract, type FlexAsChildProps as InlineAsChildProps, type FlexDivProps as InlineDivProps, type FlexNativeProps as InlineNativeProps, type FlexOwnProps as InlineOwnProps, type FlexProps as InlineProps, type FlexSpanProps as InlineSpanProps, type LayoutResponsive, type SECTION_A11Y_CONTRACT, type SPACER_A11Y_CONTRACT, type STACK_A11Y_CONTRACT, Section, type SectionA11yContract, type SectionAsChildProps, type SectionElementProps, type SectionOwnProps, type SectionProps, Spacer, type SpacerA11yContract, type SpacerAsChildProps, type SpacerAxis, type SpacerNativeProps, type SpacerOwnProps, type SpacerProps, Stack, type StackA11yContract, type StackAsChildProps, type StackDivProps, type StackOwnProps, type StackProps };
|
package/dist/navs.d.ts
CHANGED
|
@@ -12,4 +12,4 @@ import { SidebarPanel } from "./components/sidebar/sidebar-panel.js";
|
|
|
12
12
|
import { SidebarToggle } from "./components/sidebar/sidebar-toggle.js";
|
|
13
13
|
import { PaginationEllipsisProps, PaginationItemAsChildProps, PaginationItemProps, PaginationLinkProps, PaginationProps } from "./components/pagination/pagination.types.js";
|
|
14
14
|
import { Pagination, PaginationEllipsis, PaginationItem, PaginationLink } from "./components/pagination/pagination.js";
|
|
15
|
-
export { BREADCRUMB_A11Y_CONTRACT, Breadcrumb, BreadcrumbA11yContract, BreadcrumbAsChildProps, BreadcrumbCurrent, BreadcrumbCurrentAsChildProps, BreadcrumbCurrentProps, BreadcrumbItem, BreadcrumbItemAsChildProps, BreadcrumbItemProps, BreadcrumbLink, BreadcrumbLinkAsChildProps, BreadcrumbLinkProps, BreadcrumbList, BreadcrumbListAsChildProps, BreadcrumbListProps, BreadcrumbOwnProps, BreadcrumbProps, BreadcrumbSeparator, BreadcrumbSeparatorAsChildProps, BreadcrumbSeparatorProps, CollapseBreakpoint, CollapseIconPlacement, Collapsible, Nav, NavAsChildProps, NavBrand, NavBrandProps, NavDivProps, NavGroup, NavGroupProps, NavItem, NavItemAsChildProps, NavItemProps, NavItemVariant, NavLink, NavLinkProps, NavListProps, NavNavProps, NavOrientation, NavProps, NavToggle, NavToggleProps, NavVariant, Navbar, NavbarProps, Pagination, PaginationEllipsis, PaginationEllipsisProps, PaginationItem, PaginationItemAsChildProps, PaginationItemProps, PaginationLink, PaginationLinkProps, PaginationProps, Sidebar, SidebarPanel, SidebarPanelProps, SidebarProps, SidebarToggle, SidebarToggleProps };
|
|
15
|
+
export { BREADCRUMB_A11Y_CONTRACT, Breadcrumb, type BreadcrumbA11yContract, type BreadcrumbAsChildProps, BreadcrumbCurrent, type BreadcrumbCurrentAsChildProps, type BreadcrumbCurrentProps, BreadcrumbItem, type BreadcrumbItemAsChildProps, type BreadcrumbItemProps, BreadcrumbLink, type BreadcrumbLinkAsChildProps, type BreadcrumbLinkProps, BreadcrumbList, type BreadcrumbListAsChildProps, type BreadcrumbListProps, type BreadcrumbOwnProps, type BreadcrumbProps, BreadcrumbSeparator, type BreadcrumbSeparatorAsChildProps, type BreadcrumbSeparatorProps, type CollapseBreakpoint, type CollapseIconPlacement, type Collapsible, Nav, type NavAsChildProps, NavBrand, type NavBrandProps, type NavDivProps, NavGroup, type NavGroupProps, NavItem, type NavItemAsChildProps, type NavItemProps, type NavItemVariant, NavLink, type NavLinkProps, type NavListProps, type NavNavProps, type NavOrientation, type NavProps, NavToggle, type NavToggleProps, type NavVariant, Navbar, type NavbarProps, Pagination, PaginationEllipsis, type PaginationEllipsisProps, PaginationItem, type PaginationItemAsChildProps, type PaginationItemProps, PaginationLink, type PaginationLinkProps, type PaginationProps, Sidebar, SidebarPanel, type SidebarPanelProps, type SidebarProps, type SidebarToggle, type SidebarToggleProps };
|
package/dist/shells.d.ts
CHANGED
|
@@ -13,4 +13,4 @@ import { HEADER_A11Y_CONTRACT, HeaderA11yContract } from "./components/header/he
|
|
|
13
13
|
import { ShellAsChildProps, ShellDivProps, ShellMainAsChildProps, ShellMainDivProps, ShellMainMainProps, ShellMainProps, ShellNavAsChildProps, ShellNavDivProps, ShellNavProps, ShellOwnProps, ShellProps, ShellVariant } from "./components/shell/shell.types.js";
|
|
14
14
|
import { Shell, ShellMain, ShellNav } from "./components/shell/shell.js";
|
|
15
15
|
import { SHELL_A11Y_CONTRACT, ShellA11yContract } from "./components/shell/shell.a11y.js";
|
|
16
|
-
export { CollapseBreakpoint, CollapseIconPlacement, Collapsible, HEADER_A11Y_CONTRACT, Header, HeaderA11yContract, HeaderPosition, HeaderProps, NavBrand, NavBrandProps, NavGroup, NavGroupProps, NavItem, NavItemAsChildProps, NavItemProps, NavItemVariant, NavLink, NavLinkProps, NavToggle, NavToggleProps, Navbar, NavbarProps, SHELL_A11Y_CONTRACT, Shell, ShellA11yContract, ShellAsChildProps, ShellDivProps, ShellMain, ShellMainAsChildProps, ShellMainDivProps, ShellMainMainProps, ShellMainProps, ShellNav, ShellNavAsChildProps, ShellNavDivProps, ShellNavProps, ShellOwnProps, ShellProps, ShellVariant, Sidebar, SidebarPanel, SidebarPanelProps, SidebarProps, SidebarToggle, SidebarToggleProps };
|
|
16
|
+
export { type CollapseBreakpoint, type CollapseIconPlacement, type Collapsible, HEADER_A11Y_CONTRACT, Header, type HeaderA11yContract, type HeaderPosition, type HeaderProps, NavBrand, type NavBrandProps, NavGroup, type NavGroupProps, NavItem, type NavItemAsChildProps, type NavItemProps, type NavItemVariant, NavLink, type NavLinkProps, NavToggle, type NavToggleProps, Navbar, type NavbarProps, SHELL_A11Y_CONTRACT, Shell, type ShellA11yContract, type ShellAsChildProps, type ShellDivProps, ShellMain, type ShellMainAsChildProps, type ShellMainDivProps, type ShellMainMainProps, type ShellMainProps, ShellNav, type ShellNavAsChildProps, type ShellNavDivProps, type ShellNavProps, type ShellOwnProps, type ShellProps, type ShellVariant, Sidebar, SidebarPanel, type SidebarPanelProps, type SidebarProps, SidebarToggle, type SidebarToggleProps };
|
package/dist/surfaces.d.ts
CHANGED
|
@@ -13,4 +13,4 @@ import { SEPARATOR_A11Y_CONTRACT, SeparatorA11yContract } from "./components/sep
|
|
|
13
13
|
import { SkeletonAsChildProps, SkeletonOwnProps, SkeletonProps } from "./components/skeleton/skeleton.types.js";
|
|
14
14
|
import { Skeleton } from "./components/skeleton/skeleton.js";
|
|
15
15
|
import { SKELETON_A11Y_CONTRACT, SkeletonA11yContract } from "./components/skeleton/skeleton.a11y.js";
|
|
16
|
-
export { Alert, AlertHeadingTag, AlertProps, AlertVariant, BADGE_A11Y_CONTRACT, Badge, BadgeA11yContract, BadgeAsChildProps, BadgeOwnProps, BadgeProps, Card, CardActions, CardActionsProps, CardContent, CardContentProps, CardDescription, CardDescriptionProps, CardFooter, CardFooterProps, CardHeader, CardHeaderProps, CardPadding, CardProps, CardTitle, CardTitleProps, CardVariant, Separator as Divider, SeparatorAsChildProps as DividerAsChildProps, SeparatorNativeProps as DividerNativeProps, SeparatorOwnProps as DividerOwnProps, SeparatorProps as DividerProps, ListGroup, ListGroupItem, ListGroupItemAsChildProps, ListGroupItemProps, ListGroupOrientation, ListGroupProps, SEPARATOR_A11Y_CONTRACT, SKELETON_A11Y_CONTRACT, Separator, SeparatorA11yContract, SeparatorAsChildProps, SeparatorNativeProps, SeparatorOwnProps, SeparatorProps, Skeleton, SkeletonA11yContract, SkeletonAsChildProps, SkeletonOwnProps, SkeletonProps };
|
|
16
|
+
export { Alert, type AlertHeadingTag, type AlertProps, type AlertVariant, type BADGE_A11Y_CONTRACT, Badge, type BadgeA11yContract, type BadgeAsChildProps, type BadgeOwnProps, type BadgeProps, Card, CardActions, type CardActionsProps, CardContent, type CardContentProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardPadding, type CardProps, CardTitle, type CardTitleProps, type CardVariant, Separator as Divider, type SeparatorAsChildProps as DividerAsChildProps, type SeparatorNativeProps as DividerNativeProps, type SeparatorOwnProps as DividerOwnProps, type SeparatorProps as DividerProps, ListGroup, ListGroupItem, type ListGroupItemAsChildProps, type ListGroupItemProps, type ListGroupOrientation, type ListGroupProps, SEPARATOR_A11Y_CONTRACT, type SKELETON_A11Y_CONTRACT, Separator, type SeparatorA11yContract, type SeparatorAsChildProps, type SeparatorNativeProps, type SeparatorOwnProps, type SeparatorProps, Skeleton, type SkeletonA11yContract, type SkeletonAsChildProps, type SkeletonOwnProps, type SkeletonProps };
|
|
@@ -595,142 +595,6 @@
|
|
|
595
595
|
speak: none;
|
|
596
596
|
}
|
|
597
597
|
|
|
598
|
-
:where(.text-muted) {
|
|
599
|
-
color: var(--ak-color-text-muted);
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
:where(.text-bold) {
|
|
603
|
-
font-weight: var(--ak-font-weight-bold);
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
:where(.sr-only) {
|
|
607
|
-
clip: rect(0, 0, 0, 0);
|
|
608
|
-
white-space: nowrap;
|
|
609
|
-
border: 0;
|
|
610
|
-
width: 1px;
|
|
611
|
-
height: 1px;
|
|
612
|
-
margin: -1px;
|
|
613
|
-
padding: 0;
|
|
614
|
-
position: absolute;
|
|
615
|
-
overflow: hidden;
|
|
616
|
-
}
|
|
617
|
-
|
|
618
|
-
:where(.gap-1, [data-slot="flex"][data-gap="initial:1"], [data-slot="block"][data-gap="initial:1"], [data-slot="shell"][data-gap="initial:1"]) {
|
|
619
|
-
gap: var(--ak-space-1);
|
|
620
|
-
}
|
|
621
|
-
|
|
622
|
-
:where(.gap-2, [data-slot="flex"][data-gap="initial:2"], [data-slot="block"][data-gap="initial:2"], [data-slot="shell"][data-gap="initial:2"]) {
|
|
623
|
-
gap: var(--ak-space-2);
|
|
624
|
-
}
|
|
625
|
-
|
|
626
|
-
:where(.gap-3, [data-slot="flex"][data-gap="initial:3"], [data-slot="block"][data-gap="initial:3"], [data-slot="shell"][data-gap="initial:3"]) {
|
|
627
|
-
gap: var(--ak-space-3);
|
|
628
|
-
}
|
|
629
|
-
|
|
630
|
-
:where(.gap-4, [data-slot="flex"][data-gap="initial:4"], [data-slot="block"][data-gap="initial:4"], [data-slot="shell"][data-gap="initial:4"]) {
|
|
631
|
-
gap: var(--ak-space-4);
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
:where(.gap-xs, [data-slot="flex"][data-gap="initial:xs"], [data-slot="block"][data-gap="initial:xs"], [data-slot="shell"][data-gap="initial:xs"]) {
|
|
635
|
-
gap: var(--ak-space-xs);
|
|
636
|
-
}
|
|
637
|
-
|
|
638
|
-
:where(.gap-sm, [data-slot="flex"][data-gap="initial:sm"], [data-slot="block"][data-gap="initial:sm"], [data-slot="shell"][data-gap="initial:sm"]) {
|
|
639
|
-
gap: var(--ak-space-sm);
|
|
640
|
-
}
|
|
641
|
-
|
|
642
|
-
:where(.gap-md, [data-slot="flex"][data-gap="initial:md"], [data-slot="block"][data-gap="initial:md"], [data-slot="shell"][data-gap="initial:md"]) {
|
|
643
|
-
gap: var(--ak-space-md);
|
|
644
|
-
}
|
|
645
|
-
|
|
646
|
-
:where(.gap-lg, [data-slot="flex"][data-gap="initial:lg"], [data-slot="block"][data-gap="initial:lg"], [data-slot="shell"][data-gap="initial:lg"]) {
|
|
647
|
-
gap: var(--ak-space-lg);
|
|
648
|
-
}
|
|
649
|
-
|
|
650
|
-
:where(.gap-xl, [data-slot="flex"][data-gap="initial:xl"], [data-slot="block"][data-gap="initial:xl"], [data-slot="shell"][data-gap="initial:xl"]) {
|
|
651
|
-
gap: var(--ak-space-xl);
|
|
652
|
-
}
|
|
653
|
-
|
|
654
|
-
:where(.gap-x-sm, [data-slot="flex"][data-gap-x="initial:sm"], [data-slot="block"][data-gap-x="initial:sm"]) {
|
|
655
|
-
column-gap: var(--ak-space-sm);
|
|
656
|
-
}
|
|
657
|
-
|
|
658
|
-
:where(.gap-x-md, [data-slot="flex"][data-gap-x="initial:md"], [data-slot="block"][data-gap-x="initial:md"]) {
|
|
659
|
-
column-gap: var(--ak-space-md);
|
|
660
|
-
}
|
|
661
|
-
|
|
662
|
-
:where(.gap-x-lg, [data-slot="flex"][data-gap-x="initial:lg"], [data-slot="block"][data-gap-x="initial:lg"]) {
|
|
663
|
-
column-gap: var(--ak-space-lg);
|
|
664
|
-
}
|
|
665
|
-
|
|
666
|
-
:where(.gap-y-sm, [data-slot="flex"][data-gap-y="initial:sm"], [data-slot="block"][data-gap-y="initial:sm"]) {
|
|
667
|
-
row-gap: var(--ak-space-sm);
|
|
668
|
-
}
|
|
669
|
-
|
|
670
|
-
:where(.gap-y-md, [data-slot="flex"][data-gap-y="initial:md"], [data-slot="block"][data-gap-y="initial:md"]) {
|
|
671
|
-
row-gap: var(--ak-space-md);
|
|
672
|
-
}
|
|
673
|
-
|
|
674
|
-
:where(.gap-y-lg, [data-slot="flex"][data-gap-y="initial:lg"], [data-slot="block"][data-gap-y="initial:lg"]) {
|
|
675
|
-
row-gap: var(--ak-space-lg);
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
:where(.flex-col, [data-slot="flex"][data-direction="initial:column"]) {
|
|
679
|
-
flex-direction: column;
|
|
680
|
-
}
|
|
681
|
-
|
|
682
|
-
:where(.flex-row-reverse, [data-slot="flex"][data-direction="initial:row-reverse"]) {
|
|
683
|
-
flex-direction: row-reverse;
|
|
684
|
-
}
|
|
685
|
-
|
|
686
|
-
:where(.flex-col-reverse, [data-slot="flex"][data-direction="initial:column-reverse"]) {
|
|
687
|
-
flex-direction: column-reverse;
|
|
688
|
-
}
|
|
689
|
-
|
|
690
|
-
:where(.items-start, [data-slot="flex"][data-align="initial:start"], [data-slot="block"][data-align="initial:start"]) {
|
|
691
|
-
align-items: flex-start;
|
|
692
|
-
}
|
|
693
|
-
|
|
694
|
-
:where(.items-end, [data-slot="flex"][data-align="initial:end"], [data-slot="block"][data-align="initial:end"]) {
|
|
695
|
-
align-items: flex-end;
|
|
696
|
-
}
|
|
697
|
-
|
|
698
|
-
:where(.items-center, [data-slot="flex"][data-align="initial:center"], [data-slot="block"][data-align="initial:center"]) {
|
|
699
|
-
align-items: center;
|
|
700
|
-
}
|
|
701
|
-
|
|
702
|
-
:where(.items-stretch, [data-slot="flex"][data-align="initial:stretch"], [data-slot="block"][data-align="initial:stretch"]) {
|
|
703
|
-
align-items: stretch;
|
|
704
|
-
}
|
|
705
|
-
|
|
706
|
-
:where(.items-baseline, [data-slot="flex"][data-align="initial:baseline"], [data-slot="block"][data-align="initial:baseline"]) {
|
|
707
|
-
align-items: baseline;
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
:where(.justify-start, [data-slot="flex"][data-justify="initial:start"], [data-slot="block"][data-justify="initial:start"]) {
|
|
711
|
-
justify-content: flex-start;
|
|
712
|
-
}
|
|
713
|
-
|
|
714
|
-
:where(.justify-end, [data-slot="flex"][data-justify="initial:end"], [data-slot="block"][data-justify="initial:end"]) {
|
|
715
|
-
justify-content: flex-end;
|
|
716
|
-
}
|
|
717
|
-
|
|
718
|
-
:where(.justify-center, [data-slot="flex"][data-justify="initial:center"], [data-slot="block"][data-justify="initial:center"]) {
|
|
719
|
-
justify-content: center;
|
|
720
|
-
}
|
|
721
|
-
|
|
722
|
-
:where(.justify-between, [data-slot="flex"][data-justify="initial:between"], [data-slot="block"][data-justify="initial:between"]) {
|
|
723
|
-
justify-content: space-between;
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
:where(.flex-nowrap, [data-slot="flex"][data-wrap="initial:nowrap"]) {
|
|
727
|
-
flex-wrap: nowrap;
|
|
728
|
-
}
|
|
729
|
-
|
|
730
|
-
:where(.flex-wrap-reverse, [data-slot="flex"][data-wrap="initial:wrap-reverse"]) {
|
|
731
|
-
flex-wrap: wrap-reverse;
|
|
732
|
-
}
|
|
733
|
-
|
|
734
598
|
:where([data-ak-layout="true"]) {
|
|
735
599
|
display: var(--ak-display-initial);
|
|
736
600
|
margin: var(--ak-m-initial);
|
|
@@ -797,7 +661,7 @@
|
|
|
797
661
|
display: block;
|
|
798
662
|
}
|
|
799
663
|
|
|
800
|
-
:where([data-slot="container"][data-
|
|
664
|
+
:where([data-slot="container"][data-size="initial:fluid"]), :where([data-slot="container"][data-variant="default"]), :where([data-slot="container"][data-variant="sm"]), :where([data-slot="container"][data-variant="md"]), :where([data-slot="container"][data-variant="lg"]), :where([data-slot="container"][data-variant="xl"]), :where([data-slot="container"][data-variant="xxl"]), :where([data-slot="container"][data-variant="fluid"]) {
|
|
801
665
|
--ak-container-inline-size: 100%;
|
|
802
666
|
}
|
|
803
667
|
|
|
@@ -1159,11 +1023,13 @@
|
|
|
1159
1023
|
}
|
|
1160
1024
|
|
|
1161
1025
|
:where([data-slot="shell"][data-variant="sidebar"], [data-slot="shell"][data-variant="rail"]) > :where([data-slot="shell-nav"]) {
|
|
1026
|
+
min-block-size: 100vh;
|
|
1162
1027
|
padding: var(--ak-layout-page-gutter);
|
|
1163
1028
|
background: color-mix(in srgb, var(--ak-color-surface-muted) 92%, var(--ak-color-surface));
|
|
1164
1029
|
border-inline-end: 0;
|
|
1165
1030
|
border-block-end: 1px solid var(--ak-color-border);
|
|
1166
|
-
|
|
1031
|
+
flex: 0 0 100vh;
|
|
1032
|
+
align-content: stretch;
|
|
1167
1033
|
inline-size: 100%;
|
|
1168
1034
|
min-inline-size: 0;
|
|
1169
1035
|
max-inline-size: 100%;
|
|
@@ -1319,6 +1185,142 @@
|
|
|
1319
1185
|
}
|
|
1320
1186
|
}
|
|
1321
1187
|
|
|
1188
|
+
:where(.text-muted) {
|
|
1189
|
+
color: var(--ak-color-text-muted);
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
:where(.text-bold) {
|
|
1193
|
+
font-weight: var(--ak-font-weight-bold);
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1196
|
+
:where(.sr-only) {
|
|
1197
|
+
clip: rect(0, 0, 0, 0);
|
|
1198
|
+
white-space: nowrap;
|
|
1199
|
+
border: 0;
|
|
1200
|
+
width: 1px;
|
|
1201
|
+
height: 1px;
|
|
1202
|
+
margin: -1px;
|
|
1203
|
+
padding: 0;
|
|
1204
|
+
position: absolute;
|
|
1205
|
+
overflow: hidden;
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
:where(.gap-1, [data-slot="flex"][data-gap="initial:1"], [data-slot="block"][data-gap="initial:1"], [data-slot="shell"][data-gap="initial:1"]) {
|
|
1209
|
+
gap: var(--ak-space-1);
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
:where(.gap-2, [data-slot="flex"][data-gap="initial:2"], [data-slot="block"][data-gap="initial:2"], [data-slot="shell"][data-gap="initial:2"]) {
|
|
1213
|
+
gap: var(--ak-space-2);
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
:where(.gap-3, [data-slot="flex"][data-gap="initial:3"], [data-slot="block"][data-gap="initial:3"], [data-slot="shell"][data-gap="initial:3"]) {
|
|
1217
|
+
gap: var(--ak-space-3);
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1220
|
+
:where(.gap-4, [data-slot="flex"][data-gap="initial:4"], [data-slot="block"][data-gap="initial:4"], [data-slot="shell"][data-gap="initial:4"]) {
|
|
1221
|
+
gap: var(--ak-space-4);
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
:where(.gap-xs, [data-slot="flex"][data-gap="initial:xs"], [data-slot="block"][data-gap="initial:xs"], [data-slot="shell"][data-gap="initial:xs"]) {
|
|
1225
|
+
gap: var(--ak-space-xs);
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
:where(.gap-sm, [data-slot="flex"][data-gap="initial:sm"], [data-slot="block"][data-gap="initial:sm"], [data-slot="shell"][data-gap="initial:sm"]) {
|
|
1229
|
+
gap: var(--ak-space-sm);
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
:where(.gap-md, [data-slot="flex"][data-gap="initial:md"], [data-slot="block"][data-gap="initial:md"], [data-slot="shell"][data-gap="initial:md"]) {
|
|
1233
|
+
gap: var(--ak-space-md);
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1236
|
+
:where(.gap-lg, [data-slot="flex"][data-gap="initial:lg"], [data-slot="block"][data-gap="initial:lg"], [data-slot="shell"][data-gap="initial:lg"]) {
|
|
1237
|
+
gap: var(--ak-space-lg);
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
:where(.gap-xl, [data-slot="flex"][data-gap="initial:xl"], [data-slot="block"][data-gap="initial:xl"], [data-slot="shell"][data-gap="initial:xl"]) {
|
|
1241
|
+
gap: var(--ak-space-xl);
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
:where(.gap-x-sm, [data-slot="flex"][data-gap-x="initial:sm"], [data-slot="block"][data-gap-x="initial:sm"]) {
|
|
1245
|
+
column-gap: var(--ak-space-sm);
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
:where(.gap-x-md, [data-slot="flex"][data-gap-x="initial:md"], [data-slot="block"][data-gap-x="initial:md"]) {
|
|
1249
|
+
column-gap: var(--ak-space-md);
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
:where(.gap-x-lg, [data-slot="flex"][data-gap-x="initial:lg"], [data-slot="block"][data-gap-x="initial:lg"]) {
|
|
1253
|
+
column-gap: var(--ak-space-lg);
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
:where(.gap-y-sm, [data-slot="flex"][data-gap-y="initial:sm"], [data-slot="block"][data-gap-y="initial:sm"]) {
|
|
1257
|
+
row-gap: var(--ak-space-sm);
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
:where(.gap-y-md, [data-slot="flex"][data-gap-y="initial:md"], [data-slot="block"][data-gap-y="initial:md"]) {
|
|
1261
|
+
row-gap: var(--ak-space-md);
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
:where(.gap-y-lg, [data-slot="flex"][data-gap-y="initial:lg"], [data-slot="block"][data-gap-y="initial:lg"]) {
|
|
1265
|
+
row-gap: var(--ak-space-lg);
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
:where(.flex-col, [data-slot="flex"][data-direction="initial:column"], [data-slot="inline"][data-direction="initial:column"]) {
|
|
1269
|
+
flex-direction: column;
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1272
|
+
:where(.flex-row-reverse, [data-slot="flex"][data-direction="initial:row-reverse"], [data-slot="inline"][data-direction="initial:row-reverse"]) {
|
|
1273
|
+
flex-direction: row-reverse;
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1276
|
+
:where(.flex-col-reverse, [data-slot="flex"][data-direction="initial:column-reverse"], [data-slot="inline"][data-direction="initial:column-reverse"]) {
|
|
1277
|
+
flex-direction: column-reverse;
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
:where(.items-start, [data-slot="flex"][data-align="initial:start"], [data-slot="inline"][data-align="initial:start"], [data-slot="block"][data-align="initial:start"]) {
|
|
1281
|
+
align-items: flex-start;
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1284
|
+
:where(.items-end, [data-slot="flex"][data-align="initial:end"], [data-slot="inline"][data-align="initial:end"], [data-slot="block"][data-align="initial:end"]) {
|
|
1285
|
+
align-items: flex-end;
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
:where(.items-center, [data-slot="flex"][data-align="initial:center"], [data-slot="inline"][data-align="initial:center"], [data-slot="block"][data-align="initial:center"]) {
|
|
1289
|
+
align-items: center;
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1292
|
+
:where(.items-stretch, [data-slot="flex"][data-align="initial:stretch"], [data-slot="inline"][data-align="initial:stretch"], [data-slot="block"][data-align="initial:stretch"]) {
|
|
1293
|
+
align-items: stretch;
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
:where(.items-baseline, [data-slot="flex"][data-align="initial:baseline"], [data-slot="inline"][data-align="initial:baseline"], [data-slot="block"][data-align="initial:baseline"]) {
|
|
1297
|
+
align-items: baseline;
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1300
|
+
:where(.justify-start, [data-slot="flex"][data-justify="initial:start"], [data-slot="inline"][data-justify="initial:start"], [data-slot="block"][data-justify="initial:start"]) {
|
|
1301
|
+
justify-content: flex-start;
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1304
|
+
:where(.justify-end, [data-slot="flex"][data-justify="initial:end"], [data-slot="inline"][data-justify="initial:end"], [data-slot="block"][data-justify="initial:end"]) {
|
|
1305
|
+
justify-content: flex-end;
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1308
|
+
:where(.justify-center, [data-slot="flex"][data-justify="initial:center"], [data-slot="inline"][data-justify="initial:center"], [data-slot="block"][data-justify="initial:center"]) {
|
|
1309
|
+
justify-content: center;
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
:where(.justify-between, [data-slot="flex"][data-justify="initial:between"], [data-slot="inline"][data-justify="initial:between"], [data-slot="block"][data-justify="initial:between"]) {
|
|
1313
|
+
justify-content: space-between;
|
|
1314
|
+
}
|
|
1315
|
+
|
|
1316
|
+
:where(.flex-nowrap, [data-slot="flex"][data-wrap="initial:nowrap"], [data-slot="inline"][data-wrap="initial:nowrap"]) {
|
|
1317
|
+
flex-wrap: nowrap;
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1320
|
+
:where(.flex-wrap-reverse, [data-slot="flex"][data-wrap="initial:wrap-reverse"], [data-slot="inline"][data-wrap="initial:wrap-reverse"]) {
|
|
1321
|
+
flex-wrap: wrap-reverse;
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1322
1324
|
:where([data-slot="block"]) {
|
|
1323
1325
|
display: grid;
|
|
1324
1326
|
}
|
|
@@ -2162,11 +2164,17 @@
|
|
|
2162
2164
|
}
|
|
2163
2165
|
|
|
2164
2166
|
:where(.sidebar-shell, [data-slot="sidebar-shell"], .sidebar-panel, [data-slot="sidebar-panel"]) :where(.navbar-group[data-align="center"], [data-slot="navbar-group"][data-align="center"], .sidebar-group[data-align="center"], [data-slot="sidebar-group"][data-align="center"]) {
|
|
2165
|
-
justify-items:
|
|
2167
|
+
justify-items: center;
|
|
2166
2168
|
}
|
|
2167
2169
|
|
|
2168
2170
|
:where(.sidebar-shell, [data-slot="sidebar-shell"], .sidebar-panel, [data-slot="sidebar-panel"]) :where(.navbar-group[data-align="center"], [data-slot="navbar-group"][data-align="center"], .sidebar-group[data-align="center"], [data-slot="sidebar-group"][data-align="center"]) > :where(.navbar-group-label, [data-slot="navbar-group-label"], .sidebar-group-label, [data-slot="sidebar-group-label"]) {
|
|
2169
2171
|
text-align: center;
|
|
2172
|
+
inline-size: 100%;
|
|
2173
|
+
}
|
|
2174
|
+
|
|
2175
|
+
:where(.sidebar-shell, [data-slot="sidebar-shell"], .sidebar-panel, [data-slot="sidebar-panel"]) :where(.navbar-group[data-align="center"], [data-slot="navbar-group"][data-align="center"], .sidebar-group[data-align="center"], [data-slot="sidebar-group"][data-align="center"]) > :where(.navbar-group-body, [data-slot="navbar-group-body"], .sidebar-group-body, [data-slot="sidebar-group-body"]) {
|
|
2176
|
+
justify-items: center;
|
|
2177
|
+
inline-size: 100%;
|
|
2170
2178
|
}
|
|
2171
2179
|
|
|
2172
2180
|
:where(.sidebar-shell, [data-slot="sidebar-shell"], .sidebar-panel, [data-slot="sidebar-panel"]) :where(.navbar-group[data-align="end"], [data-slot="navbar-group"][data-align="end"], .sidebar-group[data-align="end"], [data-slot="sidebar-group"][data-align="end"]) {
|
|
@@ -2207,6 +2215,9 @@
|
|
|
2207
2215
|
|
|
2208
2216
|
:where(.sidebar-shell, [data-slot="sidebar-shell"], .sidebar-panel, [data-slot="sidebar-panel"]) :where(.navbar-group[data-align="center"], [data-slot="navbar-group"][data-align="center"], .sidebar-group[data-align="center"], [data-slot="sidebar-group"][data-align="center"]) :where(.nav-item, .navbar-item, [data-slot="nav-item"], [data-slot="nav-link"], .sidebar-item) {
|
|
2209
2217
|
justify-content: center;
|
|
2218
|
+
justify-self: center;
|
|
2219
|
+
inline-size: auto;
|
|
2220
|
+
max-inline-size: 100%;
|
|
2210
2221
|
}
|
|
2211
2222
|
|
|
2212
2223
|
:where(.sidebar-shell, [data-slot="sidebar-shell"], .sidebar-panel, [data-slot="sidebar-panel"]) :where(.nav-item, .navbar-item, [data-slot="nav-item"], [data-slot="nav-link"], .sidebar-item) > :where([data-slot="icon"], svg) {
|
|
@@ -4362,12 +4373,80 @@
|
|
|
4362
4373
|
display: flex;
|
|
4363
4374
|
}
|
|
4364
4375
|
|
|
4365
|
-
[data-slot="flex"] {
|
|
4376
|
+
[data-slot="flex"], [data-slot="inline"] {
|
|
4366
4377
|
gap: var(--ak-space-md);
|
|
4367
4378
|
flex-wrap: wrap;
|
|
4368
4379
|
display: flex;
|
|
4369
4380
|
}
|
|
4370
4381
|
|
|
4382
|
+
[data-slot="flex"][data-gap="initial:1"], [data-slot="inline"][data-gap="initial:1"] {
|
|
4383
|
+
gap: var(--ak-space-1);
|
|
4384
|
+
}
|
|
4385
|
+
|
|
4386
|
+
[data-slot="flex"][data-gap="initial:2"], [data-slot="inline"][data-gap="initial:2"] {
|
|
4387
|
+
gap: var(--ak-space-2);
|
|
4388
|
+
}
|
|
4389
|
+
|
|
4390
|
+
[data-slot="flex"][data-gap="initial:3"], [data-slot="inline"][data-gap="initial:3"] {
|
|
4391
|
+
gap: var(--ak-space-3);
|
|
4392
|
+
}
|
|
4393
|
+
|
|
4394
|
+
[data-slot="flex"][data-gap="initial:4"], [data-slot="inline"][data-gap="initial:4"] {
|
|
4395
|
+
gap: var(--ak-space-4);
|
|
4396
|
+
}
|
|
4397
|
+
|
|
4398
|
+
[data-slot="flex"][data-gap="initial:xs"], [data-slot="inline"][data-gap="initial:xs"] {
|
|
4399
|
+
gap: var(--ak-space-xs);
|
|
4400
|
+
}
|
|
4401
|
+
|
|
4402
|
+
[data-slot="flex"][data-gap="initial:sm"], [data-slot="inline"][data-gap="initial:sm"] {
|
|
4403
|
+
gap: var(--ak-space-sm);
|
|
4404
|
+
}
|
|
4405
|
+
|
|
4406
|
+
[data-slot="flex"][data-gap="initial:md"], [data-slot="inline"][data-gap="initial:md"] {
|
|
4407
|
+
gap: var(--ak-space-md);
|
|
4408
|
+
}
|
|
4409
|
+
|
|
4410
|
+
[data-slot="flex"][data-gap="initial:lg"], [data-slot="inline"][data-gap="initial:lg"] {
|
|
4411
|
+
gap: var(--ak-space-lg);
|
|
4412
|
+
}
|
|
4413
|
+
|
|
4414
|
+
[data-slot="flex"][data-gap="initial:xl"], [data-slot="inline"][data-gap="initial:xl"] {
|
|
4415
|
+
gap: var(--ak-space-xl);
|
|
4416
|
+
}
|
|
4417
|
+
|
|
4418
|
+
[data-slot="flex"][data-gap-x="initial:sm"], [data-slot="inline"][data-gap-x="initial:sm"] {
|
|
4419
|
+
column-gap: var(--ak-space-sm);
|
|
4420
|
+
}
|
|
4421
|
+
|
|
4422
|
+
[data-slot="flex"][data-gap-x="initial:md"], [data-slot="inline"][data-gap-x="initial:md"] {
|
|
4423
|
+
column-gap: var(--ak-space-md);
|
|
4424
|
+
}
|
|
4425
|
+
|
|
4426
|
+
[data-slot="flex"][data-gap-x="initial:lg"], [data-slot="inline"][data-gap-x="initial:lg"] {
|
|
4427
|
+
column-gap: var(--ak-space-lg);
|
|
4428
|
+
}
|
|
4429
|
+
|
|
4430
|
+
[data-slot="flex"][data-gap-y="initial:sm"], [data-slot="inline"][data-gap-y="initial:sm"] {
|
|
4431
|
+
row-gap: var(--ak-space-sm);
|
|
4432
|
+
}
|
|
4433
|
+
|
|
4434
|
+
[data-slot="flex"][data-gap-y="initial:md"], [data-slot="inline"][data-gap-y="initial:md"] {
|
|
4435
|
+
row-gap: var(--ak-space-md);
|
|
4436
|
+
}
|
|
4437
|
+
|
|
4438
|
+
[data-slot="flex"][data-gap-y="initial:lg"], [data-slot="inline"][data-gap-y="initial:lg"] {
|
|
4439
|
+
row-gap: var(--ak-space-lg);
|
|
4440
|
+
}
|
|
4441
|
+
|
|
4442
|
+
[data-slot="flex"][data-wrap="initial:nowrap"], [data-slot="inline"][data-wrap="initial:nowrap"] {
|
|
4443
|
+
flex-wrap: nowrap;
|
|
4444
|
+
}
|
|
4445
|
+
|
|
4446
|
+
[data-slot="flex"][data-wrap="initial:wrap-reverse"], [data-slot="inline"][data-wrap="initial:wrap-reverse"] {
|
|
4447
|
+
flex-wrap: wrap-reverse;
|
|
4448
|
+
}
|
|
4449
|
+
|
|
4371
4450
|
[data-slot="section"] {
|
|
4372
4451
|
display: block;
|
|
4373
4452
|
}
|
|
@@ -4512,7 +4591,7 @@
|
|
|
4512
4591
|
--ak-state-unchecked: 1;
|
|
4513
4592
|
}
|
|
4514
4593
|
|
|
4515
|
-
[data-accordion], [data-accordion-header], [data-active-item], [data-align], [data-askr-visually-hidden], [data-auto-fit], [data-avatar], [data-avatar-fallback], [data-avatar-image], [data-axis], [data-badge], [data-basis], [data-breadcrumb], [data-breadcrumb-current], [data-breadcrumb-item], [data-breadcrumb-link], [data-breadcrumb-list], [data-breadcrumb-separator], [data-centered], [data-collapse-below], [data-columns], [data-dialog-overlay], [data-dismissable-layer], [data-dropdown-label], [data-
|
|
4594
|
+
[data-accordion], [data-accordion-header], [data-active-item], [data-align], [data-askr-visually-hidden], [data-auto-fit], [data-avatar], [data-avatar-fallback], [data-avatar-image], [data-axis], [data-badge], [data-basis], [data-breadcrumb], [data-breadcrumb-current], [data-breadcrumb-item], [data-breadcrumb-link], [data-breadcrumb-list], [data-breadcrumb-separator], [data-centered], [data-collapse-below], [data-columns], [data-dialog-overlay], [data-dismissable-layer], [data-dropdown-label], [data-focus-ring], [data-focus-scope], [data-gap], [data-grow], [data-inline], [data-justify], [data-max], [data-max-width], [data-menubar], [data-menubar-label], [data-min-height], [data-min-item-width], [data-padding], [data-percentage], [data-progress], [data-progress-circle], [data-progress-circle-indicator], [data-progress-indicator], [data-required], [data-select-item-text], [data-select-label], [data-shrink], [data-side], [data-side-offset], [data-size], [data-skeleton], [data-slider], [data-slider-range], [data-slider-thumb], [data-slider-track], [data-toast], [data-toast-action], [data-toast-close], [data-toast-description], [data-toast-provider], [data-toast-title], [data-toast-viewport], [data-toggle-group], [data-value], [data-wrap] {
|
|
4516
4595
|
--ak-contract-covered: 1;
|
|
4517
4596
|
}
|
|
4518
4597
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@askrjs/themes",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "Default theme tokens, styles, and themed layout wrappers for Askr apps.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"askr",
|
|
@@ -129,26 +129,27 @@
|
|
|
129
129
|
"bench:tier2": "cross-env NODE_ENV=production vp test bench --run --reporter=default --config vitest.bench.tier2.config.ts",
|
|
130
130
|
"bench:tier3": "cross-env NODE_ENV=production vp test bench --run --reporter=default --config vitest.bench.tier3.config.ts",
|
|
131
131
|
"bench:tier4": "cross-env NODE_ENV=production vp test bench --run --reporter=default --config vitest.bench.tier4.config.ts",
|
|
132
|
-
"test": "npm run test:unit && npm run test:jsdom && npm run test:browser",
|
|
132
|
+
"test": "npm run test:unit && npm run test:checks && npm run test:jsdom && npm run test:browser",
|
|
133
133
|
"test:unit": "vp test run -c vitest.test.unit.config.ts",
|
|
134
134
|
"test:jsdom": "cross-env NODE_ENV=production vp test run -c vitest.test.jsdom.config.ts",
|
|
135
135
|
"test:browser": "vp test run -c vitest.test.browser.config.ts --mode production",
|
|
136
136
|
"fmt": "vp fmt .",
|
|
137
137
|
"lint": "vp lint .",
|
|
138
138
|
"build": "vp pack",
|
|
139
|
-
"prepublishOnly": "npm run build"
|
|
139
|
+
"prepublishOnly": "npm run build",
|
|
140
|
+
"test:checks": "vp test run -c vitest.test.checks.config.ts"
|
|
140
141
|
},
|
|
141
142
|
"devDependencies": {
|
|
142
|
-
"@askrjs/askr": "
|
|
143
|
-
"@askrjs/ui": "
|
|
144
|
-
"@askrjs/vite": "
|
|
145
|
-
"@tsdown/css": "0.22.
|
|
146
|
-
"@types/node": "^25.9.
|
|
143
|
+
"@askrjs/askr": ">=0.0.1 <0.1.0",
|
|
144
|
+
"@askrjs/ui": ">=0.0.1 <0.1.0",
|
|
145
|
+
"@askrjs/vite": ">=0.0.2 <0.1.0",
|
|
146
|
+
"@tsdown/css": "0.22.2",
|
|
147
|
+
"@types/node": "^25.9.2",
|
|
147
148
|
"cross-env": "^10.1.0",
|
|
148
149
|
"jsdom": "^29.1.1",
|
|
149
150
|
"playwright": "^1.60.0",
|
|
150
151
|
"typescript": "^6.0.3",
|
|
151
|
-
"vite-plus": "^0.1.
|
|
152
|
+
"vite-plus": "^0.1.24"
|
|
152
153
|
},
|
|
153
154
|
"peerDependencies": {
|
|
154
155
|
"@askrjs/askr": ">=0.0.1 <0.1.0",
|
|
@@ -157,5 +158,5 @@
|
|
|
157
158
|
"engines": {
|
|
158
159
|
"node": ">=18"
|
|
159
160
|
},
|
|
160
|
-
"packageManager": "npm@11.
|
|
161
|
+
"packageManager": "npm@11.16.0"
|
|
161
162
|
}
|