@askrjs/themes 0.0.25 → 0.0.28
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/style.js +2 -1
- package/dist/components/_internal/style.js.map +1 -1
- package/dist/components/alert/alert.d.ts +5 -0
- package/dist/components/alert/alert.js +5 -0
- package/dist/components/alert/alert.js.map +1 -1
- package/dist/components/alert/alert.types.d.ts +3 -0
- package/dist/components/aside/aside.d.ts +1 -0
- package/dist/components/aside/aside.js +1 -0
- package/dist/components/aside/aside.js.map +1 -1
- package/dist/components/aside/aside.types.d.ts +1 -0
- package/dist/components/aspect-ratio/aspect-ratio.d.ts +5 -0
- package/dist/components/aspect-ratio/aspect-ratio.js.map +1 -1
- package/dist/components/aspect-ratio/aspect-ratio.types.d.ts +3 -0
- package/dist/components/badge/badge.d.ts +1 -0
- package/dist/components/badge/badge.js.map +1 -1
- package/dist/components/badge/badge.types.d.ts +4 -0
- package/dist/components/block/block.d.ts +6 -0
- package/dist/components/block/block.js.map +1 -1
- package/dist/components/block/block.types.d.ts +8 -0
- package/dist/components/brand/brand.d.ts +3 -0
- package/dist/components/brand/brand.js +3 -0
- package/dist/components/brand/brand.js.map +1 -1
- package/dist/components/brand/brand.types.d.ts +6 -0
- package/dist/components/button-group/button-group.d.ts +1 -0
- package/dist/components/button-group/button-group.js +1 -0
- package/dist/components/button-group/button-group.js.map +1 -1
- package/dist/components/button-group/button-group.types.d.ts +2 -0
- package/dist/components/card/card.d.ts +7 -0
- package/dist/components/card/card.js +7 -0
- package/dist/components/card/card.js.map +1 -1
- package/dist/components/card/card.types.d.ts +9 -0
- package/dist/components/catalog.d.ts +122 -0
- package/dist/components/catalog.js +118 -0
- package/dist/components/catalog.js.map +1 -1
- package/dist/components/close/close.d.ts +1 -0
- package/dist/components/close/close.js.map +1 -1
- package/dist/components/close/close.types.d.ts +2 -0
- package/dist/components/command-palette/command-palette.d.ts +14 -0
- package/dist/components/command-palette/command-palette.js +13 -0
- package/dist/components/command-palette/command-palette.js.map +1 -1
- package/dist/components/command-palette/command-palette.types.d.ts +6 -0
- package/dist/components/container/container.d.ts +1 -0
- package/dist/components/container/container.js +1 -0
- package/dist/components/container/container.js.map +1 -1
- package/dist/components/container/container.types.d.ts +1 -0
- package/dist/components/empty-state/empty-state.d.ts +1 -0
- package/dist/components/empty-state/empty-state.js +1 -0
- package/dist/components/empty-state/empty-state.js.map +1 -1
- package/dist/components/empty-state/empty-state.types.d.ts +2 -0
- package/dist/components/field/field.d.ts +3 -0
- package/dist/components/field/field.js +3 -0
- package/dist/components/field/field.js.map +1 -1
- package/dist/components/field/field.types.d.ts +3 -0
- package/dist/components/footer/footer.d.ts +7 -0
- package/dist/components/footer/footer.js +7 -0
- package/dist/components/footer/footer.js.map +1 -1
- package/dist/components/footer/footer.types.d.ts +7 -0
- package/dist/components/grid/grid.d.ts +1 -0
- package/dist/components/grid/grid.js +1 -0
- package/dist/components/grid/grid.js.map +1 -1
- package/dist/components/grid/grid.types.d.ts +4 -0
- package/dist/components/header/header.d.ts +1 -0
- package/dist/components/header/header.js +1 -0
- package/dist/components/header/header.js.map +1 -1
- package/dist/components/header/header.types.d.ts +1 -0
- package/dist/components/input-group/input-group.d.ts +2 -0
- package/dist/components/input-group/input-group.js +1 -0
- package/dist/components/input-group/input-group.js.map +1 -1
- package/dist/components/input-group/input-group.types.d.ts +4 -0
- package/dist/components/main/main.d.ts +1 -0
- package/dist/components/main/main.js +1 -0
- package/dist/components/main/main.js.map +1 -1
- package/dist/components/main/main.types.d.ts +1 -0
- package/dist/components/nav/nav.d.ts +6 -0
- package/dist/components/nav/nav.js +3 -0
- package/dist/components/nav/nav.js.map +1 -1
- package/dist/components/nav/nav.types.d.ts +14 -0
- package/dist/components/navbar/navbar.d.ts +8 -0
- package/dist/components/navbar/navbar.js +8 -0
- package/dist/components/navbar/navbar.js.map +1 -1
- package/dist/components/navbar/navbar.types.d.ts +5 -0
- package/dist/components/overlays/dropdown-content.d.ts +5 -0
- package/dist/components/overlays/dropdown-content.js.map +1 -1
- package/dist/components/page/page.d.ts +1 -0
- package/dist/components/page/page.js +1 -0
- package/dist/components/page/page.js.map +1 -1
- package/dist/components/page/page.types.d.ts +1 -0
- package/dist/components/page-header/page-header.d.ts +1 -0
- package/dist/components/page-header/page-header.js +1 -0
- package/dist/components/page-header/page-header.js.map +1 -1
- package/dist/components/page-header/page-header.types.d.ts +1 -0
- package/dist/components/section/section.d.ts +1 -0
- package/dist/components/section/section.js +1 -0
- package/dist/components/section/section.js.map +1 -1
- package/dist/components/section/section.types.d.ts +1 -0
- package/dist/components/separator/separator.d.ts +5 -0
- package/dist/components/separator/separator.js.map +1 -1
- package/dist/components/separator/separator.types.d.ts +4 -0
- package/dist/components/sidebar/sidebar.d.ts +16 -0
- package/dist/components/sidebar/sidebar.js +16 -0
- package/dist/components/sidebar/sidebar.js.map +1 -1
- package/dist/components/sidebar/sidebar.types.d.ts +8 -0
- package/dist/components/skeleton/skeleton.d.ts +1 -0
- package/dist/components/skeleton/skeleton.js.map +1 -1
- package/dist/components/skeleton/skeleton.types.d.ts +3 -0
- package/dist/components/spinner/spinner.d.ts +1 -0
- package/dist/components/spinner/spinner.js +1 -0
- package/dist/components/spinner/spinner.js.map +1 -1
- package/dist/components/spinner/spinner.types.d.ts +3 -0
- package/dist/components/stat/stat.d.ts +4 -0
- package/dist/components/stat/stat.js +4 -0
- package/dist/components/stat/stat.js.map +1 -1
- package/dist/components/stat/stat.types.d.ts +4 -0
- package/dist/components/text/text.d.ts +1 -0
- package/dist/components/text/text.js +1 -0
- package/dist/components/text/text.js.map +1 -1
- package/dist/components/text/text.types.d.ts +8 -0
- package/dist/components/theme/theme.d.ts +25 -0
- package/dist/components/theme/theme.js +22 -3
- package/dist/components/theme/theme.js.map +1 -1
- package/dist/components/toolbar/toolbar.d.ts +1 -0
- package/dist/components/toolbar/toolbar.js +1 -0
- package/dist/components/toolbar/toolbar.js.map +1 -1
- package/dist/components/toolbar/toolbar.types.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/_internal/style.ts +8 -1
- package/src/components/alert/alert.tsx +5 -0
- package/src/components/alert/alert.types.ts +3 -0
- package/src/components/aside/aside.tsx +1 -0
- package/src/components/aside/aside.types.ts +1 -0
- package/src/components/aspect-ratio/aspect-ratio.tsx +5 -0
- package/src/components/aspect-ratio/aspect-ratio.types.ts +3 -0
- package/src/components/badge/badge.tsx +1 -0
- package/src/components/badge/badge.types.ts +4 -0
- package/src/components/block/block.tsx +6 -0
- package/src/components/block/block.types.ts +8 -0
- package/src/components/brand/brand.tsx +3 -0
- package/src/components/brand/brand.types.ts +6 -0
- package/src/components/button-group/button-group.tsx +1 -0
- package/src/components/button-group/button-group.types.ts +2 -0
- package/src/components/card/card.tsx +7 -0
- package/src/components/card/card.types.ts +9 -0
- package/src/components/catalog.tsx +122 -0
- package/src/components/close/close.tsx +1 -0
- package/src/components/close/close.types.ts +2 -0
- package/src/components/command-palette/command-palette.tsx +14 -0
- package/src/components/command-palette/command-palette.types.ts +6 -0
- package/src/components/container/container.tsx +1 -0
- package/src/components/container/container.types.ts +1 -0
- package/src/components/empty-state/empty-state.tsx +1 -0
- package/src/components/empty-state/empty-state.types.ts +2 -0
- package/src/components/field/field.tsx +3 -0
- package/src/components/field/field.types.ts +3 -0
- package/src/components/footer/footer.tsx +7 -0
- package/src/components/footer/footer.types.ts +7 -0
- package/src/components/grid/grid.tsx +1 -0
- package/src/components/grid/grid.types.ts +4 -0
- package/src/components/header/header.tsx +1 -0
- package/src/components/header/header.types.ts +1 -0
- package/src/components/input-group/input-group.tsx +2 -0
- package/src/components/input-group/input-group.types.ts +4 -0
- package/src/components/main/main.tsx +1 -0
- package/src/components/main/main.types.ts +1 -0
- package/src/components/nav/nav.tsx +6 -0
- package/src/components/nav/nav.types.ts +14 -0
- package/src/components/navbar/navbar.tsx +8 -0
- package/src/components/navbar/navbar.types.ts +5 -0
- package/src/components/overlays/dropdown-content.tsx +5 -0
- package/src/components/page/page.tsx +1 -0
- package/src/components/page/page.types.ts +1 -0
- package/src/components/page-header/page-header.tsx +1 -0
- package/src/components/page-header/page-header.types.ts +1 -0
- package/src/components/section/section.tsx +1 -0
- package/src/components/section/section.types.ts +1 -0
- package/src/components/separator/separator.tsx +5 -0
- package/src/components/separator/separator.types.ts +4 -0
- package/src/components/sidebar/sidebar.tsx +16 -0
- package/src/components/sidebar/sidebar.types.ts +8 -0
- package/src/components/skeleton/skeleton.tsx +1 -0
- package/src/components/skeleton/skeleton.types.ts +3 -0
- package/src/components/spinner/spinner.tsx +1 -0
- package/src/components/spinner/spinner.types.ts +3 -0
- package/src/components/stat/stat.tsx +4 -0
- package/src/components/stat/stat.types.ts +4 -0
- package/src/components/text/text.tsx +1 -0
- package/src/components/text/text.types.ts +8 -0
- package/src/components/theme/theme.tsx +35 -2
- package/src/components/toolbar/toolbar.tsx +1 -0
- package/src/components/toolbar/toolbar.types.ts +1 -0
|
@@ -3,6 +3,7 @@ import * as Askr from "@askrjs/askr";
|
|
|
3
3
|
const cssPropertyNameCache = /* @__PURE__ */ new Map();
|
|
4
4
|
const MAX_PROPERTY_CACHE = 256;
|
|
5
5
|
const CSS_UNSAFE_RE = /[{}<>\\]/;
|
|
6
|
+
const CSS_COMMENT_DELIMITER_RE = /\/\*|\*\//;
|
|
6
7
|
const CSS_URI_SCHEME_RE = /(?:^|[\s(,])([a-z][a-z0-9+.-]*):/i;
|
|
7
8
|
const CSS_FUNCTION_NAME_RE = /([a-z-][a-z0-9-]*)\s*\(/gi;
|
|
8
9
|
const CSS_ALLOWED_FUNCTIONS = /* @__PURE__ */ new Set([
|
|
@@ -54,7 +55,7 @@ function isSafeCssPropertyName(name) {
|
|
|
54
55
|
return /^[a-zA-Z_][a-zA-Z0-9_-]*$/.test(name);
|
|
55
56
|
}
|
|
56
57
|
function isSafeCssValue(value) {
|
|
57
|
-
if (CSS_UNSAFE_RE.test(value) || CSS_URI_SCHEME_RE.test(value)) return false;
|
|
58
|
+
if (CSS_UNSAFE_RE.test(value) || CSS_COMMENT_DELIMITER_RE.test(value) || CSS_URI_SCHEME_RE.test(value)) return false;
|
|
58
59
|
for (const match of value.matchAll(CSS_FUNCTION_NAME_RE)) if (!CSS_ALLOWED_FUNCTIONS.has(match[1].toLowerCase())) return false;
|
|
59
60
|
return true;
|
|
60
61
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","names":[],"sources":["../../../src/components/_internal/style.ts"],"sourcesContent":["import * as Askr from \"@askrjs/askr\";\n\nconst cssPropertyNameCache = new Map<string, string>();\nconst MAX_PROPERTY_CACHE = 256;\n\nconst CSS_UNSAFE_RE = /[{}<>\\\\]/;\nconst CSS_URI_SCHEME_RE = /(?:^|[\\s(,])([a-z][a-z0-9+.-]*):/i;\nconst CSS_FUNCTION_NAME_RE = /([a-z-][a-z0-9-]*)\\s*\\(/gi;\nconst CSS_ALLOWED_FUNCTIONS = new Set([\n \"var\",\n \"calc\",\n \"min\",\n \"max\",\n \"clamp\",\n \"minmax\",\n \"repeat\",\n \"rgb\",\n \"rgba\",\n \"hsl\",\n \"hsla\",\n \"lab\",\n \"lch\",\n \"oklab\",\n \"oklch\",\n \"color\",\n \"color-mix\",\n \"translate\",\n \"translatex\",\n \"translatey\",\n \"translatez\",\n \"scale\",\n \"scalex\",\n \"scaley\",\n \"scalez\",\n \"rotate\",\n \"rotatex\",\n \"rotatey\",\n \"rotatez\",\n \"skew\",\n \"skewx\",\n \"skewy\",\n \"matrix\",\n \"matrix3d\",\n \"linear-gradient\",\n \"radial-gradient\",\n \"conic-gradient\",\n \"repeating-linear-gradient\",\n \"repeating-radial-gradient\",\n \"repeating-conic-gradient\",\n \"cubic-bezier\",\n \"steps\",\n]);\n\nfunction isSafeCssPropertyName(name: string): boolean {\n if (name.startsWith(\"--\")) return /^--[a-zA-Z0-9_-]+$/.test(name);\n return /^[a-zA-Z_][a-zA-Z0-9_-]*$/.test(name);\n}\n\nfunction isSafeCssValue(value: string): boolean {\n if (CSS_UNSAFE_RE.test(value) || CSS_URI_SCHEME_RE.test(value)) return false;\n\n for (const match of value.matchAll(CSS_FUNCTION_NAME_RE)) {\n if (!CSS_ALLOWED_FUNCTIONS.has(match[1]!.toLowerCase())) return false;\n }\n\n return true;\n}\n\nfunction splitCssDeclarations(value: string): string[] {\n const declarations: string[] = [];\n let start = 0;\n let depth = 0;\n let quote: string | undefined;\n\n for (let index = 0; index < value.length; index += 1) {\n const char = value[index]!;\n if (quote) {\n if (char === quote && value[index - 1] !== \"\\\\\") quote = undefined;\n continue;\n }\n if (char === '\"' || char === \"'\") {\n quote = char;\n continue;\n }\n if (char === \"(\") depth += 1;\n if (char === \")\" && depth > 0) depth -= 1;\n if (char === \";\" && depth === 0) {\n declarations.push(value.slice(start, index));\n start = index + 1;\n }\n }\n\n declarations.push(value.slice(start));\n return declarations;\n}\n\nfunction serializeCssString(value: string): string {\n const entries: Array<[string, string]> = [];\n for (const candidate of splitCssDeclarations(value)) {\n const separator = candidate.indexOf(\":\");\n if (separator <= 0) continue;\n const key = candidate.slice(0, separator).trim();\n const cssValue = candidate.slice(separator + 1).trim();\n if (key && cssValue) entries.push([key, cssValue]);\n }\n return serializeCssDeclarations(Object.fromEntries(entries));\n}\n\nfunction cssPropertyName(name: string): string {\n let cached = cssPropertyNameCache.get(name);\n if (cached !== undefined) {\n return cached;\n }\n\n let result = \"\";\n\n for (let index = 0; index < name.length; index += 1) {\n const code = name.charCodeAt(index);\n\n if (code >= 65 && code <= 90) {\n result += `-${String.fromCharCode(code + 32)}`;\n } else {\n result += name[index];\n }\n }\n\n if (cssPropertyNameCache.size < MAX_PROPERTY_CACHE) {\n cssPropertyNameCache.set(name, result);\n }\n return result;\n}\n\nexport function serializeCssDeclarations(styles: Record<string, unknown>): string {\n const keys = Object.keys(styles);\n let result = \"\";\n\n for (const key of keys) {\n const value = styles[key];\n if (value === undefined || value === null) {\n continue;\n }\n\n const rawProperty = key.trim();\n if (!isSafeCssPropertyName(rawProperty)) {\n continue;\n }\n const property = cssPropertyName(rawProperty).trim();\n const cssValue = String(value).trim();\n if (!cssValue || !isSafeCssValue(cssValue)) {\n continue;\n }\n\n const declaration = `${property}:${cssValue}`;\n result = result ? `${result};${declaration}` : declaration;\n }\n\n return result;\n}\n\nexport function mergeCssVar(style: unknown, name: string, value: string): string {\n const decl = `${name}:${value}`;\n\n if (typeof style === \"string\") {\n const trimmed = style.trim();\n return trimmed ? `${trimmed};${decl}` : decl;\n }\n\n if (style && typeof style === \"object\") {\n const entries = serializeCssDeclarations(style as Record<string, unknown>);\n return entries ? `${entries};${decl}` : decl;\n }\n\n return decl;\n}\n\nconst STYLE_REGISTRY_ATTR = \"data-askr-style-registry\";\nconst STYLE_CLASS_PREFIX = \"ak-style-\";\nconst MAX_STYLE_RULES = 512;\nconst MAX_COLLISION_CACHE = 4096;\n\ntype StyleRule = {\n className: string;\n declarations: string;\n rule: string;\n};\n\nconst styleCollisionCache = new Map<string, StyleRule>();\ntype StyleRegistry = {\n element: HTMLStyleElement;\n ruleCount: number;\n rules: Map<string, StyleRule>;\n};\nconst registries = new WeakMap<Document, Map<string, StyleRegistry>>();\nfunction countRegisteredRules(value: string | null): number {\n return value?.match(/\\.ak-style-[a-z0-9]+\\{/g)?.length ?? 0;\n}\n\nfunction styleClassName(declarations: string): string {\n let first = 0xdeadbeef ^ declarations.length;\n let second = 0x41c6ce57 ^ declarations.length;\n\n for (let index = 0; index < declarations.length; index += 1) {\n const code = declarations.charCodeAt(index);\n first = Math.imul(first ^ code, 2_654_435_761);\n second = Math.imul(second ^ code, 1_597_334_677);\n }\n\n first =\n Math.imul(first ^ (first >>> 16), 2_246_822_507) ^\n Math.imul(second ^ (second >>> 13), 3_266_489_909);\n second =\n Math.imul(second ^ (second >>> 16), 2_246_822_507) ^\n Math.imul(first ^ (first >>> 13), 3_266_489_909);\n\n return `${STYLE_CLASS_PREFIX}${(second >>> 0).toString(36)}${(first >>> 0).toString(36)}`;\n}\n\nfunction escapeStyleRawText(value: string): string {\n return value.replace(/<\\//g, \"<\\\\/\");\n}\n\nfunction styleRuleFor(declarations: string): StyleRule {\n const className = styleClassName(declarations);\n const existing = styleCollisionCache.get(className);\n if (existing) {\n if (existing.declarations !== declarations) {\n throw new RangeError(\"Theme style class collision detected.\");\n }\n return existing;\n }\n\n const entry = {\n className,\n declarations,\n rule: `.${className}{${escapeStyleRawText(declarations)}}`,\n };\n return entry;\n}\n\nfunction rememberStyleRule(entry: StyleRule): void {\n styleCollisionCache.delete(entry.className);\n styleCollisionCache.set(entry.className, entry);\n while (styleCollisionCache.size > MAX_COLLISION_CACHE) {\n const oldest = styleCollisionCache.keys().next().value;\n if (oldest === undefined) break;\n styleCollisionCache.delete(oldest);\n }\n}\n\nfunction registerSSRStyle(entry: StyleRule): void {\n const register = (\n Askr as typeof Askr & {\n registerSSRStyle?: (id: string, cssText: string) => void;\n }\n ).registerSSRStyle;\n register?.(entry.className, entry.rule);\n}\n\nfunction ensureStyleRegistry(nonce: string | undefined): StyleRegistry | null {\n if (typeof document === \"undefined\") return null;\n const key = nonce ?? \"\";\n let documentRegistries = registries.get(document);\n if (!documentRegistries) {\n documentRegistries = new Map();\n registries.set(document, documentRegistries);\n }\n const current = documentRegistries.get(key);\n if (current?.element.isConnected) return current;\n\n const existingStyleElements = Array.from(\n document.querySelectorAll<HTMLStyleElement>(`style[${STYLE_REGISTRY_ATTR}]`),\n );\n const styleElement =\n existingStyleElements.find((element) => (element.nonce || undefined) === nonce) ??\n (nonce === undefined && existingStyleElements.length === 1\n ? existingStyleElements[0]\n : undefined) ??\n document.createElement(\"style\");\n if (!styleElement.isConnected) {\n styleElement.setAttribute(STYLE_REGISTRY_ATTR, \"true\");\n if (nonce !== undefined) styleElement.nonce = nonce;\n (document.head ?? document.documentElement).append(styleElement);\n }\n const registry: StyleRegistry = {\n element: styleElement,\n ruleCount: countRegisteredRules(styleElement.textContent),\n rules: new Map(),\n };\n documentRegistries.set(key, registry);\n return registry;\n}\n\nfunction normalizeDeclarations(declarations: string): string {\n return serializeCssString(declarations);\n}\n\nexport function styleDeclarationsToClass(declarations: string | undefined): string | undefined {\n if (typeof declarations !== \"string\") return undefined;\n\n const normalized = normalizeDeclarations(declarations);\n if (!normalized) return undefined;\n\n const entry = styleRuleFor(normalized);\n const nonce = Askr.cspNonce();\n const registry = ensureStyleRegistry(nonce);\n const registered = registry?.rules.get(normalized);\n if (registered) {\n registerSSRStyle(registered);\n return registered.className;\n }\n\n if (registry) {\n if (!registry.rules.has(normalized) && !registry.element.textContent?.includes(entry.rule)) {\n if (registry.ruleCount >= MAX_STYLE_RULES) {\n throw new RangeError(\"Theme style registry capacity exceeded.\");\n }\n }\n if (!registry.element.textContent?.includes(entry.rule)) {\n registry.element.append(entry.rule, \"\\n\");\n registry.ruleCount += 1;\n }\n registry.rules.set(normalized, entry);\n }\n\n rememberStyleRule(entry);\n registerSSRStyle(entry);\n\n return entry.className;\n}\n"],"mappings":";;AAEA,MAAM,uCAAuB,IAAI,IAAoB;AACrD,MAAM,qBAAqB;AAE3B,MAAM,gBAAgB;AACtB,MAAM,oBAAoB;AAC1B,MAAM,uBAAuB;AAC7B,MAAM,wCAAwB,IAAI,IAAI;CACpC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,SAAS,sBAAsB,MAAuB;CACpD,IAAI,KAAK,WAAW,IAAI,GAAG,OAAO,qBAAqB,KAAK,IAAI;CAChE,OAAO,4BAA4B,KAAK,IAAI;AAC9C;AAEA,SAAS,eAAe,OAAwB;CAC9C,IAAI,cAAc,KAAK,KAAK,KAAK,kBAAkB,KAAK,KAAK,GAAG,OAAO;CAEvE,KAAK,MAAM,SAAS,MAAM,SAAS,oBAAoB,GACrD,IAAI,CAA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Aa,SAAS,MAAM,IAAI,GAAG;GACvD,SAAS,QAAQ,OAAO,MAAM,MAAM,IAAI;GACxC,SAAS,aAAa;EACxB;EACA,SAAS,MAAM,IAAI,YAAY,KAAK;CACtC;CAEA,kBAAkB,KAAK;CACvB,iBAAiB,KAAK;CAEtB,OAAO,MAAM;AACf"}
|
|
1
|
+
{"version":3,"file":"style.js","names":[],"sources":["../../../src/components/_internal/style.ts"],"sourcesContent":["import * as Askr from \"@askrjs/askr\";\n\nconst cssPropertyNameCache = new Map<string, string>();\nconst MAX_PROPERTY_CACHE = 256;\n\nconst CSS_UNSAFE_RE = /[{}<>\\\\]/;\nconst CSS_COMMENT_DELIMITER_RE = /\\/\\*|\\*\\//;\nconst CSS_URI_SCHEME_RE = /(?:^|[\\s(,])([a-z][a-z0-9+.-]*):/i;\nconst CSS_FUNCTION_NAME_RE = /([a-z-][a-z0-9-]*)\\s*\\(/gi;\nconst CSS_ALLOWED_FUNCTIONS = new Set([\n \"var\",\n \"calc\",\n \"min\",\n \"max\",\n \"clamp\",\n \"minmax\",\n \"repeat\",\n \"rgb\",\n \"rgba\",\n \"hsl\",\n \"hsla\",\n \"lab\",\n \"lch\",\n \"oklab\",\n \"oklch\",\n \"color\",\n \"color-mix\",\n \"translate\",\n \"translatex\",\n \"translatey\",\n \"translatez\",\n \"scale\",\n \"scalex\",\n \"scaley\",\n \"scalez\",\n \"rotate\",\n \"rotatex\",\n \"rotatey\",\n \"rotatez\",\n \"skew\",\n \"skewx\",\n \"skewy\",\n \"matrix\",\n \"matrix3d\",\n \"linear-gradient\",\n \"radial-gradient\",\n \"conic-gradient\",\n \"repeating-linear-gradient\",\n \"repeating-radial-gradient\",\n \"repeating-conic-gradient\",\n \"cubic-bezier\",\n \"steps\",\n]);\n\nfunction isSafeCssPropertyName(name: string): boolean {\n if (name.startsWith(\"--\")) return /^--[a-zA-Z0-9_-]+$/.test(name);\n return /^[a-zA-Z_][a-zA-Z0-9_-]*$/.test(name);\n}\n\nfunction isSafeCssValue(value: string): boolean {\n if (\n CSS_UNSAFE_RE.test(value) ||\n CSS_COMMENT_DELIMITER_RE.test(value) ||\n CSS_URI_SCHEME_RE.test(value)\n ) {\n return false;\n }\n\n for (const match of value.matchAll(CSS_FUNCTION_NAME_RE)) {\n if (!CSS_ALLOWED_FUNCTIONS.has(match[1]!.toLowerCase())) return false;\n }\n\n return true;\n}\n\nfunction splitCssDeclarations(value: string): string[] {\n const declarations: string[] = [];\n let start = 0;\n let depth = 0;\n let quote: string | undefined;\n\n for (let index = 0; index < value.length; index += 1) {\n const char = value[index]!;\n if (quote) {\n if (char === quote && value[index - 1] !== \"\\\\\") quote = undefined;\n continue;\n }\n if (char === '\"' || char === \"'\") {\n quote = char;\n continue;\n }\n if (char === \"(\") depth += 1;\n if (char === \")\" && depth > 0) depth -= 1;\n if (char === \";\" && depth === 0) {\n declarations.push(value.slice(start, index));\n start = index + 1;\n }\n }\n\n declarations.push(value.slice(start));\n return declarations;\n}\n\nfunction serializeCssString(value: string): string {\n const entries: Array<[string, string]> = [];\n for (const candidate of splitCssDeclarations(value)) {\n const separator = candidate.indexOf(\":\");\n if (separator <= 0) continue;\n const key = candidate.slice(0, separator).trim();\n const cssValue = candidate.slice(separator + 1).trim();\n if (key && cssValue) entries.push([key, cssValue]);\n }\n return serializeCssDeclarations(Object.fromEntries(entries));\n}\n\nfunction cssPropertyName(name: string): string {\n let cached = cssPropertyNameCache.get(name);\n if (cached !== undefined) {\n return cached;\n }\n\n let result = \"\";\n\n for (let index = 0; index < name.length; index += 1) {\n const code = name.charCodeAt(index);\n\n if (code >= 65 && code <= 90) {\n result += `-${String.fromCharCode(code + 32)}`;\n } else {\n result += name[index];\n }\n }\n\n if (cssPropertyNameCache.size < MAX_PROPERTY_CACHE) {\n cssPropertyNameCache.set(name, result);\n }\n return result;\n}\n\nexport function serializeCssDeclarations(styles: Record<string, unknown>): string {\n const keys = Object.keys(styles);\n let result = \"\";\n\n for (const key of keys) {\n const value = styles[key];\n if (value === undefined || value === null) {\n continue;\n }\n\n const rawProperty = key.trim();\n if (!isSafeCssPropertyName(rawProperty)) {\n continue;\n }\n const property = cssPropertyName(rawProperty).trim();\n const cssValue = String(value).trim();\n if (!cssValue || !isSafeCssValue(cssValue)) {\n continue;\n }\n\n const declaration = `${property}:${cssValue}`;\n result = result ? `${result};${declaration}` : declaration;\n }\n\n return result;\n}\n\nexport function mergeCssVar(style: unknown, name: string, value: string): string {\n const decl = `${name}:${value}`;\n\n if (typeof style === \"string\") {\n const trimmed = style.trim();\n return trimmed ? `${trimmed};${decl}` : decl;\n }\n\n if (style && typeof style === \"object\") {\n const entries = serializeCssDeclarations(style as Record<string, unknown>);\n return entries ? `${entries};${decl}` : decl;\n }\n\n return decl;\n}\n\nconst STYLE_REGISTRY_ATTR = \"data-askr-style-registry\";\nconst STYLE_CLASS_PREFIX = \"ak-style-\";\nconst MAX_STYLE_RULES = 512;\nconst MAX_COLLISION_CACHE = 4096;\n\ntype StyleRule = {\n className: string;\n declarations: string;\n rule: string;\n};\n\nconst styleCollisionCache = new Map<string, StyleRule>();\ntype StyleRegistry = {\n element: HTMLStyleElement;\n ruleCount: number;\n rules: Map<string, StyleRule>;\n};\nconst registries = new WeakMap<Document, Map<string, StyleRegistry>>();\nfunction countRegisteredRules(value: string | null): number {\n return value?.match(/\\.ak-style-[a-z0-9]+\\{/g)?.length ?? 0;\n}\n\nfunction styleClassName(declarations: string): string {\n let first = 0xdeadbeef ^ declarations.length;\n let second = 0x41c6ce57 ^ declarations.length;\n\n for (let index = 0; index < declarations.length; index += 1) {\n const code = declarations.charCodeAt(index);\n first = Math.imul(first ^ code, 2_654_435_761);\n second = Math.imul(second ^ code, 1_597_334_677);\n }\n\n first =\n Math.imul(first ^ (first >>> 16), 2_246_822_507) ^\n Math.imul(second ^ (second >>> 13), 3_266_489_909);\n second =\n Math.imul(second ^ (second >>> 16), 2_246_822_507) ^\n Math.imul(first ^ (first >>> 13), 3_266_489_909);\n\n return `${STYLE_CLASS_PREFIX}${(second >>> 0).toString(36)}${(first >>> 0).toString(36)}`;\n}\n\nfunction escapeStyleRawText(value: string): string {\n return value.replace(/<\\//g, \"<\\\\/\");\n}\n\nfunction styleRuleFor(declarations: string): StyleRule {\n const className = styleClassName(declarations);\n const existing = styleCollisionCache.get(className);\n if (existing) {\n if (existing.declarations !== declarations) {\n throw new RangeError(\"Theme style class collision detected.\");\n }\n return existing;\n }\n\n const entry = {\n className,\n declarations,\n rule: `.${className}{${escapeStyleRawText(declarations)}}`,\n };\n return entry;\n}\n\nfunction rememberStyleRule(entry: StyleRule): void {\n styleCollisionCache.delete(entry.className);\n styleCollisionCache.set(entry.className, entry);\n while (styleCollisionCache.size > MAX_COLLISION_CACHE) {\n const oldest = styleCollisionCache.keys().next().value;\n if (oldest === undefined) break;\n styleCollisionCache.delete(oldest);\n }\n}\n\nfunction registerSSRStyle(entry: StyleRule): void {\n const register = (\n Askr as typeof Askr & {\n registerSSRStyle?: (id: string, cssText: string) => void;\n }\n ).registerSSRStyle;\n register?.(entry.className, entry.rule);\n}\n\nfunction ensureStyleRegistry(nonce: string | undefined): StyleRegistry | null {\n if (typeof document === \"undefined\") return null;\n const key = nonce ?? \"\";\n let documentRegistries = registries.get(document);\n if (!documentRegistries) {\n documentRegistries = new Map();\n registries.set(document, documentRegistries);\n }\n const current = documentRegistries.get(key);\n if (current?.element.isConnected) return current;\n\n const existingStyleElements = Array.from(\n document.querySelectorAll<HTMLStyleElement>(`style[${STYLE_REGISTRY_ATTR}]`),\n );\n const styleElement =\n existingStyleElements.find((element) => (element.nonce || undefined) === nonce) ??\n (nonce === undefined && existingStyleElements.length === 1\n ? existingStyleElements[0]\n : undefined) ??\n document.createElement(\"style\");\n if (!styleElement.isConnected) {\n styleElement.setAttribute(STYLE_REGISTRY_ATTR, \"true\");\n if (nonce !== undefined) styleElement.nonce = nonce;\n (document.head ?? document.documentElement).append(styleElement);\n }\n const registry: StyleRegistry = {\n element: styleElement,\n ruleCount: countRegisteredRules(styleElement.textContent),\n rules: new Map(),\n };\n documentRegistries.set(key, registry);\n return registry;\n}\n\nfunction normalizeDeclarations(declarations: string): string {\n return serializeCssString(declarations);\n}\n\nexport function styleDeclarationsToClass(declarations: string | undefined): string | undefined {\n if (typeof declarations !== \"string\") return undefined;\n\n const normalized = normalizeDeclarations(declarations);\n if (!normalized) return undefined;\n\n const entry = styleRuleFor(normalized);\n const nonce = Askr.cspNonce();\n const registry = ensureStyleRegistry(nonce);\n const registered = registry?.rules.get(normalized);\n if (registered) {\n registerSSRStyle(registered);\n return registered.className;\n }\n\n if (registry) {\n if (!registry.rules.has(normalized) && !registry.element.textContent?.includes(entry.rule)) {\n if (registry.ruleCount >= MAX_STYLE_RULES) {\n throw new RangeError(\"Theme style registry capacity exceeded.\");\n }\n }\n if (!registry.element.textContent?.includes(entry.rule)) {\n registry.element.append(entry.rule, \"\\n\");\n registry.ruleCount += 1;\n }\n registry.rules.set(normalized, entry);\n }\n\n rememberStyleRule(entry);\n registerSSRStyle(entry);\n\n return entry.className;\n}\n"],"mappings":";;AAEA,MAAM,uCAAuB,IAAI,IAAoB;AACrD,MAAM,qBAAqB;AAE3B,MAAM,gBAAgB;AACtB,MAAM,2BAA2B;AACjC,MAAM,oBAAoB;AAC1B,MAAM,uBAAuB;AAC7B,MAAM,wCAAwB,IAAI,IAAI;CACpC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,SAAS,sBAAsB,MAAuB;CACpD,IAAI,KAAK,WAAW,IAAI,GAAG,OAAO,qBAAqB,KAAK,IAAI;CAChE,OAAO,4BAA4B,KAAK,IAAI;AAC9C;AAEA,SAAS,eAAe,OAAwB;CAC9C,IACE,cAAc,KAAK,KAAK,KACxB,yBAA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AAS,MAAM,IAAI,GACnF;OAAA,SAAS,aAAa,iBACxB,MAAM,IAAI,WAAW,yCAAyC;EAAA;EAGlE,IAAI,CAAC,SAAS,QAAQ,aAAa,SAAS,MAAM,IAAI,GAAG;GACvD,SAAS,QAAQ,OAAO,MAAM,MAAM,IAAI;GACxC,SAAS,aAAa;EACxB;EACA,SAAS,MAAM,IAAI,YAAY,KAAK;CACtC;CAEA,kBAAkB,KAAK;CACvB,iBAAiB,KAAK;CAEtB,OAAO,MAAM;AACf"}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { AlertProps } from "./alert.types.js";
|
|
2
2
|
import { JSX } from "@askrjs/askr/jsx-runtime";
|
|
3
3
|
//#region src/components/alert/alert.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Renders an alert/status banner with an optional icon, title, description,
|
|
6
|
+
* actions, and a dismiss button. Automatically picks an "alert" or "status"
|
|
7
|
+
* ARIA role from `variant` unless `role` is set explicitly.
|
|
8
|
+
*/
|
|
4
9
|
declare function Alert(props: AlertProps): JSX.Element;
|
|
5
10
|
//#endregion
|
|
6
11
|
export { Alert };
|
|
@@ -6,6 +6,11 @@ function resolveAlertRole(variant) {
|
|
|
6
6
|
if (variant === "danger" || variant === "warning") return "alert";
|
|
7
7
|
return "status";
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Renders an alert/status banner with an optional icon, title, description,
|
|
11
|
+
* actions, and a dismiss button. Automatically picks an "alert" or "status"
|
|
12
|
+
* ARIA role from `variant` unless `role` is set explicitly.
|
|
13
|
+
*/
|
|
9
14
|
function Alert(props) {
|
|
10
15
|
const { actions, children, class: className, description, dismissLabel = "Dismiss alert", icon, onDismiss, ref, title, titleAs: TitleTag = "h3", variant = "default", role, ...rest } = props;
|
|
11
16
|
const shouldRenderDismiss = onDismiss !== void 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert.js","names":[],"sources":["../../../src/components/alert/alert.tsx"],"sourcesContent":["import type { JSX } from \"@askrjs/askr/jsx-runtime\";\nimport { classes } from \"../_internal/classes\";\nimport { Close } from \"../close\";\nimport type { AlertProps } from \"./alert.types\";\n\nfunction resolveAlertRole(variant: AlertProps[\"variant\"] | undefined): \"alert\" | \"status\" {\n if (variant === \"danger\" || variant === \"warning\") {\n return \"alert\";\n }\n\n return \"status\";\n}\n\nexport function Alert(props: AlertProps): JSX.Element {\n const {\n actions,\n children,\n class: className,\n description,\n dismissLabel = \"Dismiss alert\",\n icon,\n onDismiss,\n ref,\n title,\n titleAs: TitleTag = \"h3\",\n variant = \"default\",\n role,\n ...rest\n } = props;\n const shouldRenderDismiss = onDismiss !== undefined;\n const resolvedRole = role ?? resolveAlertRole(variant);\n const hasVariant = variant !== \"default\";\n\n return (\n <div\n {...rest}\n ref={ref}\n class={classes(\n \"alert\",\n hasVariant ? `alert-${variant}` : undefined,\n shouldRenderDismiss ? \"alert-dismissible\" : undefined,\n className,\n )}\n data-dismissible={shouldRenderDismiss ? \"true\" : undefined}\n data-slot=\"alert\"\n data-variant={hasVariant ? variant : undefined}\n role={resolvedRole as string}\n >\n {icon !== undefined ? (\n <div aria-hidden=\"true\" class=\"alert-icon\" data-slot=\"alert-icon\">\n {icon}\n </div>\n ) : null}\n\n <div class=\"alert-content\" data-slot=\"alert-content\">\n {title !== undefined ? (\n <TitleTag class=\"alert-title\" data-slot=\"alert-title\">\n {title}\n </TitleTag>\n ) : null}\n\n {description !== undefined ? (\n <p class=\"alert-description\" data-slot=\"alert-description\">\n {description}\n </p>\n ) : null}\n\n {children}\n\n {actions !== undefined ? (\n <div class=\"alert-actions\" data-slot=\"alert-actions\">\n {actions}\n </div>\n ) : null}\n </div>\n\n {shouldRenderDismiss ? (\n <div class=\"alert-close\" data-slot=\"alert-close\">\n <Close label={dismissLabel} onPress={onDismiss} />\n </div>\n ) : null}\n </div>\n );\n}\n"],"mappings":";;;;AAKA,SAAS,iBAAiB,SAAgE;CACxF,IAAI,YAAY,YAAY,YAAY,WACtC,OAAO;CAGT,OAAO;AACT
|
|
1
|
+
{"version":3,"file":"alert.js","names":[],"sources":["../../../src/components/alert/alert.tsx"],"sourcesContent":["import type { JSX } from \"@askrjs/askr/jsx-runtime\";\nimport { classes } from \"../_internal/classes\";\nimport { Close } from \"../close\";\nimport type { AlertProps } from \"./alert.types\";\n\nfunction resolveAlertRole(variant: AlertProps[\"variant\"] | undefined): \"alert\" | \"status\" {\n if (variant === \"danger\" || variant === \"warning\") {\n return \"alert\";\n }\n\n return \"status\";\n}\n\n/**\n * Renders an alert/status banner with an optional icon, title, description,\n * actions, and a dismiss button. Automatically picks an \"alert\" or \"status\"\n * ARIA role from `variant` unless `role` is set explicitly.\n */\nexport function Alert(props: AlertProps): JSX.Element {\n const {\n actions,\n children,\n class: className,\n description,\n dismissLabel = \"Dismiss alert\",\n icon,\n onDismiss,\n ref,\n title,\n titleAs: TitleTag = \"h3\",\n variant = \"default\",\n role,\n ...rest\n } = props;\n const shouldRenderDismiss = onDismiss !== undefined;\n const resolvedRole = role ?? resolveAlertRole(variant);\n const hasVariant = variant !== \"default\";\n\n return (\n <div\n {...rest}\n ref={ref}\n class={classes(\n \"alert\",\n hasVariant ? `alert-${variant}` : undefined,\n shouldRenderDismiss ? \"alert-dismissible\" : undefined,\n className,\n )}\n data-dismissible={shouldRenderDismiss ? \"true\" : undefined}\n data-slot=\"alert\"\n data-variant={hasVariant ? variant : undefined}\n role={resolvedRole as string}\n >\n {icon !== undefined ? (\n <div aria-hidden=\"true\" class=\"alert-icon\" data-slot=\"alert-icon\">\n {icon}\n </div>\n ) : null}\n\n <div class=\"alert-content\" data-slot=\"alert-content\">\n {title !== undefined ? (\n <TitleTag class=\"alert-title\" data-slot=\"alert-title\">\n {title}\n </TitleTag>\n ) : null}\n\n {description !== undefined ? (\n <p class=\"alert-description\" data-slot=\"alert-description\">\n {description}\n </p>\n ) : null}\n\n {children}\n\n {actions !== undefined ? (\n <div class=\"alert-actions\" data-slot=\"alert-actions\">\n {actions}\n </div>\n ) : null}\n </div>\n\n {shouldRenderDismiss ? (\n <div class=\"alert-close\" data-slot=\"alert-close\">\n <Close label={dismissLabel} onPress={onDismiss} />\n </div>\n ) : null}\n </div>\n );\n}\n"],"mappings":";;;;AAKA,SAAS,iBAAiB,SAAgE;CACxF,IAAI,YAAY,YAAY,YAAY,WACtC,OAAO;CAGT,OAAO;AACT;;;;;;AAOA,SAAgB,MAAM,OAAgC;CACpD,MAAM,EACJ,SACA,UACA,OAAO,WACP,aACA,eAAe,iBACf,MACA,WACA,KACA,OACA,SAAS,WAAW,MACpB,UAAU,WACV,MACA,GAAG,SACD;CACJ,MAAM,sBAAsB,cAAc,KAAA;CAC1C,MAAM,eAAe,QAAQ,iBAAiB,OAAO;CACrD,MAAM,aAAa,YAAY;CAE/B,OACE,qBAAC,OAAD;EACE,GAAI;EACC;EACL,OAAO,QACL,SACA,aAAa,SAAS,YAAY,KAAA,GAClC,sBAAsB,sBAAsB,KAAA,GAC5C,SACF;EACA,oBAAkB,sBAAsB,SAAS,KAAA;EACjD,aAAU;EACV,gBAAc,aAAa,UAAU,KAAA;EACrC,MAAM;EAZR,UAAA;GAcG,SAAS,KAAA,IACR,oBAAC,OAAD;IAAK,eAAY;IAAO,OAAM;IAAa,aAAU;IAClD,UAAA;GACE,CAAA,IACH;GAEJ,qBAAC,OAAD;IAAK,OAAM;IAAgB,aAAU;IAArC,UAAA;KACG,UAAU,KAAA,IACT,oBAAC,UAAD;MAAU,OAAM;MAAc,aAAU;MACrC,UAAA;KACO,CAAA,IACR;KAEH,gBAAgB,KAAA,IACf,oBAAC,KAAD;MAAG,OAAM;MAAoB,aAAU;MACpC,UAAA;KACA,CAAA,IACD;KAEH;KAEA,YAAY,KAAA,IACX,oBAAC,OAAD;MAAK,OAAM;MAAgB,aAAU;MAClC,UAAA;KACE,CAAA,IACH;IACD;;GAEJ,sBACC,oBAAC,OAAD;IAAK,OAAM;IAAc,aAAU;IACjC,UAAA,oBAAC,OAAD;KAAO,OAAO;KAAc,SAAS;IAAY,CAAA;GAC9C,CAAA,IACH;EACD;;AAET"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { JSX } from "@askrjs/askr/jsx-runtime";
|
|
2
2
|
import { Ref } from "@askrjs/askr/foundations/utilities";
|
|
3
3
|
//#region src/components/alert/alert.types.d.ts
|
|
4
|
+
/** Visual tone of an {@link AlertProps} alert; `"danger"`/`"warning"` render with `role="alert"`. */
|
|
4
5
|
type AlertVariant = "default" | "info" | "success" | "warning" | "danger";
|
|
6
|
+
/** Heading tag allowed for an alert's title via `titleAs`. */
|
|
5
7
|
type AlertHeadingTag = "h2" | "h3" | "h4" | "h5" | "h6";
|
|
6
8
|
type DivProps = Omit<JSX.IntrinsicElements["div"], "children" | "ref">;
|
|
9
|
+
/** Props for the {@link Alert} component. */
|
|
7
10
|
type AlertProps = DivProps & {
|
|
8
11
|
actions?: unknown;
|
|
9
12
|
children?: unknown;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AsideProps } from "./aside.types.js";
|
|
2
2
|
import { JSX } from "@askrjs/askr/jsx-runtime";
|
|
3
3
|
//#region src/components/aside/aside.d.ts
|
|
4
|
+
/** Renders a `<aside>`-element {@link Block} tagged with `data-slot="aside"`. */
|
|
4
5
|
declare function Aside(props: AsideProps): JSX.Element;
|
|
5
6
|
//#endregion
|
|
6
7
|
export { Aside };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Block } from "../block/block.js";
|
|
2
2
|
import { jsx } from "@askrjs/askr/jsx-runtime";
|
|
3
3
|
//#region src/components/aside/aside.tsx
|
|
4
|
+
/** Renders a `<aside>`-element {@link Block} tagged with `data-slot="aside"`. */
|
|
4
5
|
function Aside(props) {
|
|
5
6
|
const { children, ...rest } = props;
|
|
6
7
|
return /* @__PURE__ */ jsx(Block, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aside.js","names":[],"sources":["../../../src/components/aside/aside.tsx"],"sourcesContent":["import type { JSX } from \"@askrjs/askr/jsx-runtime\";\nimport { Block } from \"../block\";\nimport type { AsideProps } from \"./aside.types\";\n\nexport function Aside(props: AsideProps): JSX.Element {\n const { children, ...rest } = props;\n\n return (\n <Block as=\"aside\" {...rest} data-slot=\"aside\">\n {children}\n </Block>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"aside.js","names":[],"sources":["../../../src/components/aside/aside.tsx"],"sourcesContent":["import type { JSX } from \"@askrjs/askr/jsx-runtime\";\nimport { Block } from \"../block\";\nimport type { AsideProps } from \"./aside.types\";\n\n/** Renders a `<aside>`-element {@link Block} tagged with `data-slot=\"aside\"`. */\nexport function Aside(props: AsideProps): JSX.Element {\n const { children, ...rest } = props;\n\n return (\n <Block as=\"aside\" {...rest} data-slot=\"aside\">\n {children}\n </Block>\n );\n}\n"],"mappings":";;;;AAKA,SAAgB,MAAM,OAAgC;CACpD,MAAM,EAAE,UAAU,GAAG,SAAS;CAE9B,OACE,oBAAC,OAAD;EAAO,IAAG;EAAQ,GAAI;EAAM,aAAU;EACnC;CACI,CAAA;AAEX"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BlockElementProps } from "../block/block.types.js";
|
|
2
2
|
import "../block/index.js";
|
|
3
3
|
//#region src/components/aside/aside.types.d.ts
|
|
4
|
+
/** Props for the {@link Aside} component. */
|
|
4
5
|
type AsideProps = Omit<BlockElementProps<"aside">, "as">;
|
|
5
6
|
//#endregion
|
|
6
7
|
export { AsideProps };
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { AspectRatioAsChildProps, AspectRatioProps } from "./aspect-ratio.types.js";
|
|
2
2
|
import { JSX } from "@askrjs/askr/jsx-runtime";
|
|
3
3
|
//#region src/components/aspect-ratio/aspect-ratio.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Constrains its content to a fixed width/height ratio (defaults to `1`)
|
|
6
|
+
* using a computed `aspect-ratio` style, rendering as a `<div>` or, with
|
|
7
|
+
* `asChild`, merging its layout into the single child element.
|
|
8
|
+
*/
|
|
4
9
|
declare function AspectRatio(props: AspectRatioProps): JSX.Element;
|
|
5
10
|
declare function AspectRatio(props: AspectRatioAsChildProps): JSX.Element;
|
|
6
11
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aspect-ratio.js","names":[],"sources":["../../../src/components/aspect-ratio/aspect-ratio.tsx"],"sourcesContent":["import type { JSX } from \"@askrjs/askr/jsx-runtime\";\nimport { Slot } from \"@askrjs/askr/foundations\";\nimport { mergeProps } from \"../_internal/merge-props\";\nimport { mergeLayoutStyles } from \"../_internal/block-layout\";\nimport { styleDeclarationsToClass } from \"../_internal/style\";\nimport { intrinsicElement } from \"../_internal/jsx\";\nimport type { AspectRatioAsChildProps, AspectRatioProps } from \"./aspect-ratio.types\";\n\nexport function AspectRatio(props: AspectRatioProps): JSX.Element;\nexport function AspectRatio(props: AspectRatioAsChildProps): JSX.Element;\nexport function AspectRatio(props: AspectRatioProps | AspectRatioAsChildProps) {\n const { asChild, children, ratio = 1, ref, style, ...rest } = props;\n const layoutClass = styleDeclarationsToClass(\n mergeLayoutStyles(\n {\n display: \"block\",\n width: \"100%\",\n aspectRatio: String(ratio),\n overflow: \"hidden\",\n },\n style,\n ),\n );\n\n const finalProps = mergeProps(rest, {\n ref,\n \"data-slot\": \"aspect-ratio\",\n ...(layoutClass ? { class: layoutClass } : {}),\n });\n\n if (asChild) {\n return <Slot asChild {...finalProps} children={children} />;\n }\n\n return intrinsicElement(\"div\", finalProps, children);\n}\n"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"aspect-ratio.js","names":[],"sources":["../../../src/components/aspect-ratio/aspect-ratio.tsx"],"sourcesContent":["import type { JSX } from \"@askrjs/askr/jsx-runtime\";\nimport { Slot } from \"@askrjs/askr/foundations\";\nimport { mergeProps } from \"../_internal/merge-props\";\nimport { mergeLayoutStyles } from \"../_internal/block-layout\";\nimport { styleDeclarationsToClass } from \"../_internal/style\";\nimport { intrinsicElement } from \"../_internal/jsx\";\nimport type { AspectRatioAsChildProps, AspectRatioProps } from \"./aspect-ratio.types\";\n\n/**\n * Constrains its content to a fixed width/height ratio (defaults to `1`)\n * using a computed `aspect-ratio` style, rendering as a `<div>` or, with\n * `asChild`, merging its layout into the single child element.\n */\nexport function AspectRatio(props: AspectRatioProps): JSX.Element;\nexport function AspectRatio(props: AspectRatioAsChildProps): JSX.Element;\nexport function AspectRatio(props: AspectRatioProps | AspectRatioAsChildProps) {\n const { asChild, children, ratio = 1, ref, style, ...rest } = props;\n const layoutClass = styleDeclarationsToClass(\n mergeLayoutStyles(\n {\n display: \"block\",\n width: \"100%\",\n aspectRatio: String(ratio),\n overflow: \"hidden\",\n },\n style,\n ),\n );\n\n const finalProps = mergeProps(rest, {\n ref,\n \"data-slot\": \"aspect-ratio\",\n ...(layoutClass ? { class: layoutClass } : {}),\n });\n\n if (asChild) {\n return <Slot asChild {...finalProps} children={children} />;\n }\n\n return intrinsicElement(\"div\", finalProps, children);\n}\n"],"mappings":";;;;;;;AAeA,SAAgB,YAAY,OAAmD;CAC7E,MAAM,EAAE,SAAS,UAAU,QAAQ,GAAG,KAAK,OAAO,GAAG,SAAS;CAC9D,MAAM,cAAc,yBAClB,kBACE;EACE,SAAS;EACT,OAAO;EACP,aAAa,OAAO,KAAK;EACzB,UAAU;CACZ,GACA,KACF,CACF;CAEA,MAAM,aAAa,WAAW,MAAM;EAClC;EACA,aAAa;EACb,GAAI,cAAc,EAAE,OAAO,YAAY,IAAI,CAAC;CAC9C,CAAC;CAED,IAAI,SACF,OAAO,oBAAC,MAAD;EAAM,SAAA;EAAQ,GAAI;EAAsB;CAAW,CAAA;CAG5D,OAAO,iBAAiB,OAAO,YAAY,QAAQ;AACrD"}
|
|
@@ -2,15 +2,18 @@ import { JSX } from "@askrjs/askr/jsx-runtime";
|
|
|
2
2
|
import { JSXElement } from "@askrjs/askr/foundations";
|
|
3
3
|
import { Ref } from "@askrjs/askr/foundations/utilities";
|
|
4
4
|
//#region src/components/aspect-ratio/aspect-ratio.types.d.ts
|
|
5
|
+
/** Props shared by both {@link AspectRatio} call signatures. */
|
|
5
6
|
type AspectRatioOwnProps = {
|
|
6
7
|
children?: unknown;
|
|
7
8
|
ratio?: number | string;
|
|
8
9
|
style?: unknown;
|
|
9
10
|
};
|
|
11
|
+
/** Props for {@link AspectRatio} rendered as its default `<div>` element. */
|
|
10
12
|
type AspectRatioProps = Omit<JSX.IntrinsicElements["div"], "children" | "ref"> & AspectRatioOwnProps & {
|
|
11
13
|
asChild?: false;
|
|
12
14
|
ref?: Ref<HTMLDivElement>;
|
|
13
15
|
};
|
|
16
|
+
/** Props for {@link AspectRatio} rendered with `asChild`, merging layout onto a single child element. */
|
|
14
17
|
type AspectRatioAsChildProps = AspectRatioOwnProps & {
|
|
15
18
|
asChild: true;
|
|
16
19
|
children: JSXElement;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BadgeAsChildProps, BadgeProps } from "./badge.types.js";
|
|
2
2
|
import { JSX } from "@askrjs/askr/jsx-runtime";
|
|
3
3
|
//#region src/components/badge/badge.d.ts
|
|
4
|
+
/** Renders a small status/label badge, defaulting to a `<span>` (or merging onto a child via `asChild`), with a `variant` color modifier. */
|
|
4
5
|
declare function Badge(props: BadgeProps): JSX.Element;
|
|
5
6
|
declare function Badge(props: BadgeAsChildProps): JSX.Element;
|
|
6
7
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.js","names":[],"sources":["../../../src/components/badge/badge.tsx"],"sourcesContent":["import type { JSX } from \"@askrjs/askr/jsx-runtime\";\nimport { Slot } from \"@askrjs/askr/foundations\";\nimport { classes } from \"../_internal/classes\";\nimport { mergeProps } from \"../_internal/merge-props\";\nimport { intrinsicElement } from \"../_internal/jsx\";\nimport type { BadgeAsChildProps, BadgeProps } from \"./badge.types\";\n\nfunction normalizeBadgeVariant(variant: BadgeProps[\"variant\"] | undefined) {\n return variant && variant !== \"default\" ? `badge-${variant}` : undefined;\n}\n\nexport function Badge(props: BadgeProps): JSX.Element;\nexport function Badge(props: BadgeAsChildProps): JSX.Element;\nexport function Badge(props: BadgeProps | BadgeAsChildProps) {\n const { asChild, children, variant, ref, ...rest } = props;\n const finalProps = mergeProps(rest, {\n class: classes(\"badge\", normalizeBadgeVariant(variant)),\n ref,\n \"data-slot\": \"badge\",\n \"data-badge\": \"true\",\n \"data-variant\": variant && variant !== \"default\" ? variant : undefined,\n });\n\n if (asChild) {\n return <Slot asChild {...finalProps} children={children} />;\n }\n\n return intrinsicElement(\"span\", finalProps, children);\n}\n"],"mappings":";;;;;;AAOA,SAAS,sBAAsB,SAA4C;CACzE,OAAO,WAAW,YAAY,YAAY,SAAS,YAAY,KAAA;AACjE;
|
|
1
|
+
{"version":3,"file":"badge.js","names":[],"sources":["../../../src/components/badge/badge.tsx"],"sourcesContent":["import type { JSX } from \"@askrjs/askr/jsx-runtime\";\nimport { Slot } from \"@askrjs/askr/foundations\";\nimport { classes } from \"../_internal/classes\";\nimport { mergeProps } from \"../_internal/merge-props\";\nimport { intrinsicElement } from \"../_internal/jsx\";\nimport type { BadgeAsChildProps, BadgeProps } from \"./badge.types\";\n\nfunction normalizeBadgeVariant(variant: BadgeProps[\"variant\"] | undefined) {\n return variant && variant !== \"default\" ? `badge-${variant}` : undefined;\n}\n\n/** Renders a small status/label badge, defaulting to a `<span>` (or merging onto a child via `asChild`), with a `variant` color modifier. */\nexport function Badge(props: BadgeProps): JSX.Element;\nexport function Badge(props: BadgeAsChildProps): JSX.Element;\nexport function Badge(props: BadgeProps | BadgeAsChildProps) {\n const { asChild, children, variant, ref, ...rest } = props;\n const finalProps = mergeProps(rest, {\n class: classes(\"badge\", normalizeBadgeVariant(variant)),\n ref,\n \"data-slot\": \"badge\",\n \"data-badge\": \"true\",\n \"data-variant\": variant && variant !== \"default\" ? variant : undefined,\n });\n\n if (asChild) {\n return <Slot asChild {...finalProps} children={children} />;\n }\n\n return intrinsicElement(\"span\", finalProps, children);\n}\n"],"mappings":";;;;;;AAOA,SAAS,sBAAsB,SAA4C;CACzE,OAAO,WAAW,YAAY,YAAY,SAAS,YAAY,KAAA;AACjE;AAKA,SAAgB,MAAM,OAAuC;CAC3D,MAAM,EAAE,SAAS,UAAU,SAAS,KAAK,GAAG,SAAS;CACrD,MAAM,aAAa,WAAW,MAAM;EAClC,OAAO,QAAQ,SAAS,sBAAsB,OAAO,CAAC;EACtD;EACA,aAAa;EACb,cAAc;EACd,gBAAgB,WAAW,YAAY,YAAY,UAAU,KAAA;CAC/D,CAAC;CAED,IAAI,SACF,OAAO,oBAAC,MAAD;EAAM,SAAA;EAAQ,GAAI;EAAsB;CAAW,CAAA;CAG5D,OAAO,iBAAiB,QAAQ,YAAY,QAAQ;AACtD"}
|
|
@@ -2,15 +2,19 @@ import { JSX } from "@askrjs/askr/jsx-runtime";
|
|
|
2
2
|
import { JSXElement } from "@askrjs/askr/foundations";
|
|
3
3
|
import { Ref } from "@askrjs/askr/foundations/utilities";
|
|
4
4
|
//#region src/components/badge/badge.types.d.ts
|
|
5
|
+
/** Visual tone of a {@link BadgeProps} badge. */
|
|
5
6
|
type BadgeVariant = "default" | "secondary" | "outline" | "success" | "warning" | "danger" | "info";
|
|
7
|
+
/** Props shared by both {@link Badge} call signatures. */
|
|
6
8
|
type BadgeOwnProps = {
|
|
7
9
|
children?: unknown;
|
|
8
10
|
variant?: BadgeVariant;
|
|
9
11
|
};
|
|
12
|
+
/** Props for {@link Badge} rendered as its default `<span>` element. */
|
|
10
13
|
type BadgeProps = Omit<JSX.IntrinsicElements["span"], "children" | "ref"> & BadgeOwnProps & {
|
|
11
14
|
asChild?: false;
|
|
12
15
|
ref?: Ref<HTMLSpanElement>;
|
|
13
16
|
};
|
|
17
|
+
/** Props for {@link Badge} rendered with `asChild`, merging its attributes onto a single child element. */
|
|
14
18
|
type BadgeAsChildProps = BadgeOwnProps & {
|
|
15
19
|
asChild: true;
|
|
16
20
|
children: JSXElement;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { BlockAsChildProps, BlockNativeProps } from "./block.types.js";
|
|
2
2
|
import { JSX } from "@askrjs/askr/jsx-runtime";
|
|
3
3
|
//#region src/components/block/block.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Low-level layout primitive: renders any element in {@link BlockElement}
|
|
6
|
+
* (default `<div>`) and turns layout-only props (spacing, alignment,
|
|
7
|
+
* direction, sizing, etc.) into a generated utility class. With `asChild`,
|
|
8
|
+
* the layout is merged onto a single child element instead of a wrapper.
|
|
9
|
+
*/
|
|
4
10
|
declare function Block(props: BlockNativeProps): JSX.Element;
|
|
5
11
|
declare function Block(props: BlockAsChildProps): JSX.Element;
|
|
6
12
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block.js","names":[],"sources":["../../../src/components/block/block.tsx"],"sourcesContent":["import type { JSX } from \"@askrjs/askr/jsx-runtime\";\nimport { Slot } from \"@askrjs/askr/foundations\";\nimport { classes } from \"../_internal/classes\";\nimport {\n applyBlockLayoutStyles,\n mergeLayoutStyles,\n splitBlockLayoutProps,\n} from \"../_internal/block-layout\";\nimport { mergeProps } from \"../_internal/merge-props\";\nimport { intrinsicElement } from \"../_internal/jsx\";\nimport { styleDeclarationsToClass } from \"../_internal/style\";\nimport type { BlockAsChildProps, BlockNativeProps } from \"./block.types\";\n\nconst DEFAULT_ELEMENT = \"div\";\n\nexport function Block(props: BlockNativeProps): JSX.Element;\nexport function Block(props: BlockAsChildProps): JSX.Element;\nexport function Block(props: BlockNativeProps | BlockAsChildProps) {\n const {\n as: asProp,\n asChild,\n children,\n ref,\n class: classProp,\n className,\n style: userStyle,\n ...rest\n } = props as (BlockNativeProps | BlockAsChildProps) & {\n as?: BlockNativeProps[\"as\"];\n class?: unknown;\n className?: unknown;\n style?: unknown;\n };\n const as = asProp ?? DEFAULT_ELEMENT;\n\n const { blockProps, rest: passthroughProps } = splitBlockLayoutProps(rest);\n const layoutStyle: Record<string, string | number> = {};\n applyBlockLayoutStyles(layoutStyle, blockProps);\n\n const layoutClass = styleDeclarationsToClass(mergeLayoutStyles(layoutStyle, userStyle));\n const slot =\n typeof (passthroughProps as Record<string, unknown>)[\"data-slot\"] === \"string\"\n ? String((passthroughProps as Record<string, unknown>)[\"data-slot\"])\n : \"block\";\n\n const finalProps = mergeProps(passthroughProps, {\n ref,\n class: classes(classProp, className, layoutClass),\n \"data-slot\": slot,\n \"data-ak-layout\": \"true\",\n });\n\n if (asChild) {\n return <Slot asChild {...finalProps} children={children as JSX.Element} />;\n }\n\n return intrinsicElement(as ?? DEFAULT_ELEMENT, finalProps, children);\n}\n"],"mappings":";;;;;;;;AAaA,MAAM,kBAAkB;
|
|
1
|
+
{"version":3,"file":"block.js","names":[],"sources":["../../../src/components/block/block.tsx"],"sourcesContent":["import type { JSX } from \"@askrjs/askr/jsx-runtime\";\nimport { Slot } from \"@askrjs/askr/foundations\";\nimport { classes } from \"../_internal/classes\";\nimport {\n applyBlockLayoutStyles,\n mergeLayoutStyles,\n splitBlockLayoutProps,\n} from \"../_internal/block-layout\";\nimport { mergeProps } from \"../_internal/merge-props\";\nimport { intrinsicElement } from \"../_internal/jsx\";\nimport { styleDeclarationsToClass } from \"../_internal/style\";\nimport type { BlockAsChildProps, BlockNativeProps } from \"./block.types\";\n\nconst DEFAULT_ELEMENT = \"div\";\n\n/**\n * Low-level layout primitive: renders any element in {@link BlockElement}\n * (default `<div>`) and turns layout-only props (spacing, alignment,\n * direction, sizing, etc.) into a generated utility class. With `asChild`,\n * the layout is merged onto a single child element instead of a wrapper.\n */\nexport function Block(props: BlockNativeProps): JSX.Element;\nexport function Block(props: BlockAsChildProps): JSX.Element;\nexport function Block(props: BlockNativeProps | BlockAsChildProps) {\n const {\n as: asProp,\n asChild,\n children,\n ref,\n class: classProp,\n className,\n style: userStyle,\n ...rest\n } = props as (BlockNativeProps | BlockAsChildProps) & {\n as?: BlockNativeProps[\"as\"];\n class?: unknown;\n className?: unknown;\n style?: unknown;\n };\n const as = asProp ?? DEFAULT_ELEMENT;\n\n const { blockProps, rest: passthroughProps } = splitBlockLayoutProps(rest);\n const layoutStyle: Record<string, string | number> = {};\n applyBlockLayoutStyles(layoutStyle, blockProps);\n\n const layoutClass = styleDeclarationsToClass(mergeLayoutStyles(layoutStyle, userStyle));\n const slot =\n typeof (passthroughProps as Record<string, unknown>)[\"data-slot\"] === \"string\"\n ? String((passthroughProps as Record<string, unknown>)[\"data-slot\"])\n : \"block\";\n\n const finalProps = mergeProps(passthroughProps, {\n ref,\n class: classes(classProp, className, layoutClass),\n \"data-slot\": slot,\n \"data-ak-layout\": \"true\",\n });\n\n if (asChild) {\n return <Slot asChild {...finalProps} children={children as JSX.Element} />;\n }\n\n return intrinsicElement(as ?? DEFAULT_ELEMENT, finalProps, children);\n}\n"],"mappings":";;;;;;;;AAaA,MAAM,kBAAkB;AAUxB,SAAgB,MAAM,OAA6C;CACjE,MAAM,EACJ,IAAI,QACJ,SACA,UACA,KACA,OAAO,WACP,WACA,OAAO,WACP,GAAG,SACD;CAMJ,MAAM,KAAK,UAAU;CAErB,MAAM,EAAE,YAAY,MAAM,qBAAqB,sBAAsB,IAAI;CACzE,MAAM,cAA+C,CAAC;CACtD,uBAAuB,aAAa,UAAU;CAE9C,MAAM,cAAc,yBAAyB,kBAAkB,aAAa,SAAS,CAAC;CACtF,MAAM,OACJ,OAAQ,iBAA6C,iBAAiB,WAClE,OAAQ,iBAA6C,YAAY,IACjE;CAEN,MAAM,aAAa,WAAW,kBAAkB;EAC9C;EACA,OAAO,QAAQ,WAAW,WAAW,WAAW;EAChD,aAAa;EACb,kBAAkB;CACpB,CAAC;CAED,IAAI,SACF,OAAO,oBAAC,MAAD;EAAM,SAAA;EAAQ,GAAI;EAAsB;CAA0B,CAAA;CAG3E,OAAO,iBAAiB,MAAM,iBAAiB,YAAY,QAAQ;AACrE"}
|
|
@@ -3,25 +3,33 @@ import { JSX } from "@askrjs/askr/jsx-runtime";
|
|
|
3
3
|
import { JSXElement } from "@askrjs/askr/foundations";
|
|
4
4
|
import { Ref } from "@askrjs/askr/foundations/utilities";
|
|
5
5
|
//#region src/components/block/block.types.d.ts
|
|
6
|
+
/** Element tags {@link Block} can render as via its `as` prop. */
|
|
6
7
|
type BlockElement = "div" | "span" | "main" | "header" | "footer" | "section" | "aside" | "nav" | "a" | "ul" | "ol" | "li" | "form" | "article";
|
|
8
|
+
/** Layout and structural props accepted by {@link Block}, independent of the rendered element. */
|
|
7
9
|
type BlockOwnProps = BlockLayoutProps & {
|
|
8
10
|
as?: BlockElement;
|
|
9
11
|
children?: unknown;
|
|
10
12
|
className?: string;
|
|
11
13
|
};
|
|
14
|
+
/** {@link Block} props specialized for a given {@link BlockElement} tag `TElement`. */
|
|
12
15
|
type BlockElementProps<TElement extends BlockElement> = Omit<JSX.IntrinsicElements[TElement], "children" | "ref"> & BlockOwnProps & {
|
|
13
16
|
as?: TElement;
|
|
14
17
|
asChild?: false;
|
|
15
18
|
ref?: Ref<unknown>;
|
|
16
19
|
};
|
|
20
|
+
/** Union of {@link BlockElementProps} across every {@link BlockElement}, used for {@link Block}'s native (non-`asChild`) overload. */
|
|
17
21
|
type BlockNativeProps = { [TElement in BlockElement]: BlockElementProps<TElement>; }[BlockElement];
|
|
22
|
+
/** Props for {@link Block} rendered with `asChild`, merging layout onto a single child element. */
|
|
18
23
|
type BlockAsChildProps = Omit<BlockOwnProps, "as"> & {
|
|
19
24
|
asChild: true;
|
|
20
25
|
children: JSXElement;
|
|
21
26
|
ref?: Ref<unknown>;
|
|
22
27
|
};
|
|
28
|
+
/** {@link Block} props specialized for a `<div>` element. */
|
|
23
29
|
type BlockDivProps = BlockElementProps<"div">;
|
|
30
|
+
/** {@link Block} props specialized for a `<span>` element. */
|
|
24
31
|
type BlockSpanProps = BlockElementProps<"span">;
|
|
32
|
+
/** Union of all prop shapes accepted by {@link Block}. */
|
|
25
33
|
type BlockProps = BlockNativeProps | BlockAsChildProps;
|
|
26
34
|
//#endregion
|
|
27
35
|
export { type BlockAlign, BlockAsChildProps, type BlockBackground, type BlockDirection, BlockDivProps, BlockElement, BlockElementProps, type BlockJustify, type BlockMargin, BlockNativeProps, BlockOwnProps, BlockProps, type BlockRadius, type ResponsiveValue as BlockResponsiveValue, type BlockRowFrom, type BlockShadow, type BlockSize, type BlockSpace, BlockSpanProps, type BlockZIndex };
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { BrandLabelProps, BrandMarkProps, BrandProps } from "./brand.types.js";
|
|
2
2
|
import { JSX } from "@askrjs/askr/jsx-runtime";
|
|
3
3
|
//#region src/components/brand/brand.d.ts
|
|
4
|
+
/** Renders a brand/logo wrapper, defaulting to a `<div>` (or `<a>`/`<span>` via `as`), or merges onto a single child via `asChild`. */
|
|
4
5
|
declare function Brand<TElement extends "div" | "a" | "span" = "div">(props: BrandProps<TElement>): JSX.Element;
|
|
6
|
+
/** Renders the icon/mark portion of a {@link Brand}. */
|
|
5
7
|
declare function BrandMark(props: BrandMarkProps): JSX.Element;
|
|
8
|
+
/** Renders the text label portion of a {@link Brand}. */
|
|
6
9
|
declare function BrandLabel(props: BrandLabelProps): JSX.Element;
|
|
7
10
|
//#endregion
|
|
8
11
|
export { Brand, BrandLabel, BrandMark };
|
|
@@ -5,6 +5,7 @@ import { jsx } from "@askrjs/askr/jsx-runtime";
|
|
|
5
5
|
import { Slot } from "@askrjs/askr/foundations";
|
|
6
6
|
//#region src/components/brand/brand.tsx
|
|
7
7
|
const DEFAULT_ELEMENT = "div";
|
|
8
|
+
/** Renders a brand/logo wrapper, defaulting to a `<div>` (or `<a>`/`<span>` via `as`), or merges onto a single child via `asChild`. */
|
|
8
9
|
function Brand(props) {
|
|
9
10
|
const { as: asProp, asChild, children, class: classProp, className, ref, ...rest } = props;
|
|
10
11
|
const as = asProp;
|
|
@@ -20,6 +21,7 @@ function Brand(props) {
|
|
|
20
21
|
});
|
|
21
22
|
return intrinsicElement(as ?? DEFAULT_ELEMENT, finalProps, children);
|
|
22
23
|
}
|
|
24
|
+
/** Renders the icon/mark portion of a {@link Brand}. */
|
|
23
25
|
function BrandMark(props) {
|
|
24
26
|
const { children, class: className, ref, ...rest } = props;
|
|
25
27
|
const finalProps = mergeProps(rest, {
|
|
@@ -32,6 +34,7 @@ function BrandMark(props) {
|
|
|
32
34
|
children
|
|
33
35
|
});
|
|
34
36
|
}
|
|
37
|
+
/** Renders the text label portion of a {@link Brand}. */
|
|
35
38
|
function BrandLabel(props) {
|
|
36
39
|
const { children, class: className, ref, ...rest } = props;
|
|
37
40
|
const finalProps = mergeProps(rest, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brand.js","names":[],"sources":["../../../src/components/brand/brand.tsx"],"sourcesContent":["import type { JSX } from \"@askrjs/askr/jsx-runtime\";\nimport { Slot } from \"@askrjs/askr/foundations\";\nimport { classes } from \"../_internal/classes\";\nimport { mergeProps } from \"../_internal/merge-props\";\nimport { intrinsicElement } from \"../_internal/jsx\";\nimport type {\n BrandAsChildProps,\n BrandLabelProps,\n BrandMarkProps,\n BrandNativeProps,\n BrandProps,\n} from \"./brand.types\";\n\nconst DEFAULT_ELEMENT = \"div\";\n\nexport function Brand<TElement extends \"div\" | \"a\" | \"span\" = \"div\">(\n props: BrandProps<TElement>,\n): JSX.Element {\n const {\n as: asProp,\n asChild,\n children,\n class: classProp,\n className,\n ref,\n ...rest\n } = props as (BrandNativeProps | BrandAsChildProps) & {\n as?: \"div\" | \"a\" | \"span\";\n };\n const as = asProp;\n\n const finalProps = mergeProps(rest, {\n ref,\n class: classes(\"brand\", classProp, className),\n \"data-slot\": \"brand\",\n });\n\n if (asChild) {\n return <Slot asChild {...finalProps} children={children as JSX.Element} />;\n }\n\n return intrinsicElement(as ?? DEFAULT_ELEMENT, finalProps, children);\n}\n\nexport function BrandMark(props: BrandMarkProps): JSX.Element {\n const { children, class: className, ref, ...rest } = props;\n const finalProps = mergeProps(rest, {\n ref,\n class: classes(\"brand-mark\", className),\n \"data-slot\": \"brand-mark\",\n });\n\n return <span {...finalProps}>{children}</span>;\n}\n\nexport function BrandLabel(props: BrandLabelProps): JSX.Element {\n const { children, class: className, ref, ...rest } = props;\n const finalProps = mergeProps(rest, {\n ref,\n class: classes(\"brand-label\", className),\n \"data-slot\": \"brand-label\",\n });\n\n return <span {...finalProps}>{children}</span>;\n}\n"],"mappings":";;;;;;AAaA,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"brand.js","names":[],"sources":["../../../src/components/brand/brand.tsx"],"sourcesContent":["import type { JSX } from \"@askrjs/askr/jsx-runtime\";\nimport { Slot } from \"@askrjs/askr/foundations\";\nimport { classes } from \"../_internal/classes\";\nimport { mergeProps } from \"../_internal/merge-props\";\nimport { intrinsicElement } from \"../_internal/jsx\";\nimport type {\n BrandAsChildProps,\n BrandLabelProps,\n BrandMarkProps,\n BrandNativeProps,\n BrandProps,\n} from \"./brand.types\";\n\nconst DEFAULT_ELEMENT = \"div\";\n\n/** Renders a brand/logo wrapper, defaulting to a `<div>` (or `<a>`/`<span>` via `as`), or merges onto a single child via `asChild`. */\nexport function Brand<TElement extends \"div\" | \"a\" | \"span\" = \"div\">(\n props: BrandProps<TElement>,\n): JSX.Element {\n const {\n as: asProp,\n asChild,\n children,\n class: classProp,\n className,\n ref,\n ...rest\n } = props as (BrandNativeProps | BrandAsChildProps) & {\n as?: \"div\" | \"a\" | \"span\";\n };\n const as = asProp;\n\n const finalProps = mergeProps(rest, {\n ref,\n class: classes(\"brand\", classProp, className),\n \"data-slot\": \"brand\",\n });\n\n if (asChild) {\n return <Slot asChild {...finalProps} children={children as JSX.Element} />;\n }\n\n return intrinsicElement(as ?? DEFAULT_ELEMENT, finalProps, children);\n}\n\n/** Renders the icon/mark portion of a {@link Brand}. */\nexport function BrandMark(props: BrandMarkProps): JSX.Element {\n const { children, class: className, ref, ...rest } = props;\n const finalProps = mergeProps(rest, {\n ref,\n class: classes(\"brand-mark\", className),\n \"data-slot\": \"brand-mark\",\n });\n\n return <span {...finalProps}>{children}</span>;\n}\n\n/** Renders the text label portion of a {@link Brand}. */\nexport function BrandLabel(props: BrandLabelProps): JSX.Element {\n const { children, class: className, ref, ...rest } = props;\n const finalProps = mergeProps(rest, {\n ref,\n class: classes(\"brand-label\", className),\n \"data-slot\": \"brand-label\",\n });\n\n return <span {...finalProps}>{children}</span>;\n}\n"],"mappings":";;;;;;AAaA,MAAM,kBAAkB;;AAGxB,SAAgB,MACd,OACa;CACb,MAAM,EACJ,IAAI,QACJ,SACA,UACA,OAAO,WACP,WACA,KACA,GAAG,SACD;CAGJ,MAAM,KAAK;CAEX,MAAM,aAAa,WAAW,MAAM;EAClC;EACA,OAAO,QAAQ,SAAS,WAAW,SAAS;EAC5C,aAAa;CACf,CAAC;CAED,IAAI,SACF,OAAO,oBAAC,MAAD;EAAM,SAAA;EAAQ,GAAI;EAAsB;CAA0B,CAAA;CAG3E,OAAO,iBAAiB,MAAM,iBAAiB,YAAY,QAAQ;AACrE;;AAGA,SAAgB,UAAU,OAAoC;CAC5D,MAAM,EAAE,UAAU,OAAO,WAAW,KAAK,GAAG,SAAS;CACrD,MAAM,aAAa,WAAW,MAAM;EAClC;EACA,OAAO,QAAQ,cAAc,SAAS;EACtC,aAAa;CACf,CAAC;CAED,OAAO,oBAAC,QAAD;EAAM,GAAI;EAAa;CAAe,CAAA;AAC/C;;AAGA,SAAgB,WAAW,OAAqC;CAC9D,MAAM,EAAE,UAAU,OAAO,WAAW,KAAK,GAAG,SAAS;CACrD,MAAM,aAAa,WAAW,MAAM;EAClC;EACA,OAAO,QAAQ,eAAe,SAAS;EACvC,aAAa;CACf,CAAC;CAED,OAAO,oBAAC,QAAD;EAAM,GAAI;EAAa;CAAe,CAAA;AAC/C"}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { JSX } from "@askrjs/askr/jsx-runtime";
|
|
2
2
|
import { Ref } from "@askrjs/askr/foundations/utilities";
|
|
3
3
|
//#region src/components/brand/brand.types.d.ts
|
|
4
|
+
/** Element tags {@link Brand} can render as via its `as` prop. */
|
|
4
5
|
type BrandElement = "div" | "a" | "span";
|
|
5
6
|
type BrandIntrinsicProps<TElement extends BrandElement> = Omit<JSX.IntrinsicElements[TElement], "children" | "ref">;
|
|
6
7
|
type SpanProps = Omit<JSX.IntrinsicElements["span"], "children" | "ref">;
|
|
8
|
+
/** {@link Brand} props for its native (non-`asChild`) rendering, specialized for a given {@link BrandElement} `TElement`. */
|
|
7
9
|
type BrandNativeProps<TElement extends BrandElement = "div"> = BrandIntrinsicProps<TElement> & {
|
|
8
10
|
as?: TElement;
|
|
9
11
|
asChild?: false;
|
|
10
12
|
children?: unknown;
|
|
11
13
|
ref?: Ref<HTMLElement>;
|
|
12
14
|
};
|
|
15
|
+
/** Props for {@link Brand} rendered with `asChild`, merging its attributes onto a single child element. */
|
|
13
16
|
type BrandAsChildProps = {
|
|
14
17
|
asChild: true;
|
|
15
18
|
children: JSX.Element;
|
|
@@ -17,11 +20,14 @@ type BrandAsChildProps = {
|
|
|
17
20
|
className?: string;
|
|
18
21
|
ref?: Ref<HTMLElement>;
|
|
19
22
|
};
|
|
23
|
+
/** Union of all prop shapes accepted by {@link Brand}. */
|
|
20
24
|
type BrandProps<TElement extends BrandElement = "div"> = BrandNativeProps<TElement> | BrandAsChildProps;
|
|
25
|
+
/** Props for the {@link BrandMark} component. */
|
|
21
26
|
type BrandMarkProps = SpanProps & {
|
|
22
27
|
children?: unknown;
|
|
23
28
|
ref?: Ref<HTMLSpanElement>;
|
|
24
29
|
};
|
|
30
|
+
/** Props for the {@link BrandLabel} component. */
|
|
25
31
|
type BrandLabelProps = SpanProps & {
|
|
26
32
|
children?: unknown;
|
|
27
33
|
ref?: Ref<HTMLSpanElement>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ButtonGroupProps } from "./button-group.types.js";
|
|
2
2
|
import { JSX } from "@askrjs/askr/jsx-runtime";
|
|
3
3
|
//#region src/components/button-group/button-group.d.ts
|
|
4
|
+
/** Groups related buttons together, optionally visually attached, with a horizontal or vertical orientation and `role="group"` by default. */
|
|
4
5
|
declare function ButtonGroup(props: ButtonGroupProps): JSX.Element;
|
|
5
6
|
//#endregion
|
|
6
7
|
export { ButtonGroup };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { classes } from "../_internal/classes.js";
|
|
2
2
|
import { jsx } from "@askrjs/askr/jsx-runtime";
|
|
3
3
|
//#region src/components/button-group/button-group.tsx
|
|
4
|
+
/** Groups related buttons together, optionally visually attached, with a horizontal or vertical orientation and `role="group"` by default. */
|
|
4
5
|
function ButtonGroup(props) {
|
|
5
6
|
const { attached = true, children, class: className, orientation = "horizontal", ref, role, ...rest } = props;
|
|
6
7
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-group.js","names":[],"sources":["../../../src/components/button-group/button-group.tsx"],"sourcesContent":["import type { JSX } from \"@askrjs/askr/jsx-runtime\";\nimport { classes } from \"../_internal/classes\";\nimport { ButtonGroupProps } from \"./button-group.types\";\n\nexport function ButtonGroup(props: ButtonGroupProps): JSX.Element {\n const {\n attached = true,\n children,\n class: className,\n orientation = \"horizontal\",\n ref,\n role,\n ...rest\n } = props;\n\n return (\n <div\n {...rest}\n ref={ref}\n class={classes(\n \"btn-group\",\n orientation === \"vertical\" ? \"btn-group-vertical\" : undefined,\n className,\n )}\n data-attached={attached ? \"true\" : \"false\"}\n data-orientation={orientation}\n data-slot=\"button-group\"\n role={(role ?? \"group\") as string}\n >\n {children}\n </div>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"button-group.js","names":[],"sources":["../../../src/components/button-group/button-group.tsx"],"sourcesContent":["import type { JSX } from \"@askrjs/askr/jsx-runtime\";\nimport { classes } from \"../_internal/classes\";\nimport { ButtonGroupProps } from \"./button-group.types\";\n\n/** Groups related buttons together, optionally visually attached, with a horizontal or vertical orientation and `role=\"group\"` by default. */\nexport function ButtonGroup(props: ButtonGroupProps): JSX.Element {\n const {\n attached = true,\n children,\n class: className,\n orientation = \"horizontal\",\n ref,\n role,\n ...rest\n } = props;\n\n return (\n <div\n {...rest}\n ref={ref}\n class={classes(\n \"btn-group\",\n orientation === \"vertical\" ? \"btn-group-vertical\" : undefined,\n className,\n )}\n data-attached={attached ? \"true\" : \"false\"}\n data-orientation={orientation}\n data-slot=\"button-group\"\n role={(role ?? \"group\") as string}\n >\n {children}\n </div>\n );\n}\n"],"mappings":";;;;AAKA,SAAgB,YAAY,OAAsC;CAChE,MAAM,EACJ,WAAW,MACX,UACA,OAAO,WACP,cAAc,cACd,KACA,MACA,GAAG,SACD;CAEJ,OACE,oBAAC,OAAD;EACE,GAAI;EACC;EACL,OAAO,QACL,aACA,gBAAgB,aAAa,uBAAuB,KAAA,GACpD,SACF;EACA,iBAAe,WAAW,SAAS;EACnC,oBAAkB;EAClB,aAAU;EACV,MAAO,QAAQ;EAEd;CACE,CAAA;AAET"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { JSX } from "@askrjs/askr/jsx-runtime";
|
|
2
2
|
import { Ref } from "@askrjs/askr/foundations/utilities";
|
|
3
3
|
//#region src/components/button-group/button-group.types.d.ts
|
|
4
|
+
/** Layout direction of a {@link ButtonGroup}. */
|
|
4
5
|
type ButtonGroupOrientation = "horizontal" | "vertical";
|
|
5
6
|
type DivProps = Omit<JSX.IntrinsicElements["div"], "children" | "ref">;
|
|
7
|
+
/** Props for the {@link ButtonGroup} component. */
|
|
6
8
|
type ButtonGroupProps = DivProps & {
|
|
7
9
|
children?: unknown;
|
|
8
10
|
attached?: boolean;
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import { CardActionProps, CardContentProps, CardDescriptionProps, CardFooterProps, CardHeaderProps, CardProps, CardTitleProps } from "./card.types.js";
|
|
2
2
|
import { JSX } from "@askrjs/askr/jsx-runtime";
|
|
3
3
|
//#region src/components/card/card.d.ts
|
|
4
|
+
/** Root card container; applies the `card` class and an optional `variant` modifier. */
|
|
4
5
|
declare function Card(props: CardProps): JSX.Element;
|
|
6
|
+
/** Renders the header region of a {@link Card}. */
|
|
5
7
|
declare function CardHeader(props: CardHeaderProps): JSX.Element;
|
|
8
|
+
/** Renders a {@link Card}'s title, defaulting to an `<h3>` (override with `titleAs`). */
|
|
6
9
|
declare function CardTitle(props: CardTitleProps): JSX.Element;
|
|
10
|
+
/** Renders a {@link Card}'s supporting description text. */
|
|
7
11
|
declare function CardDescription(props: CardDescriptionProps): JSX.Element;
|
|
12
|
+
/** Renders the main content region of a {@link Card}. */
|
|
8
13
|
declare function CardContent(props: CardContentProps): JSX.Element;
|
|
14
|
+
/** Renders the footer region of a {@link Card}. */
|
|
9
15
|
declare function CardFooter(props: CardFooterProps): JSX.Element;
|
|
16
|
+
/** Renders an action/control region of a {@link Card}, typically positioned alongside the header. */
|
|
10
17
|
declare function CardAction(props: CardActionProps): JSX.Element;
|
|
11
18
|
//#endregion
|
|
12
19
|
export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
|
|
@@ -5,6 +5,7 @@ import { jsx } from "@askrjs/askr/jsx-runtime";
|
|
|
5
5
|
function normalizeVariant(variant) {
|
|
6
6
|
return variant && variant !== "default" ? variant : void 0;
|
|
7
7
|
}
|
|
8
|
+
/** Root card container; applies the `card` class and an optional `variant` modifier. */
|
|
8
9
|
function Card(props) {
|
|
9
10
|
const { children, class: className, variant, ref, ...rest } = props;
|
|
10
11
|
const normalizedVariant = normalizeVariant(variant);
|
|
@@ -19,6 +20,7 @@ function Card(props) {
|
|
|
19
20
|
children
|
|
20
21
|
});
|
|
21
22
|
}
|
|
23
|
+
/** Renders the header region of a {@link Card}. */
|
|
22
24
|
function CardHeader(props) {
|
|
23
25
|
const { children, class: className, ref, ...rest } = props;
|
|
24
26
|
const finalProps = mergeProps(rest, {
|
|
@@ -31,6 +33,7 @@ function CardHeader(props) {
|
|
|
31
33
|
children
|
|
32
34
|
});
|
|
33
35
|
}
|
|
36
|
+
/** Renders a {@link Card}'s title, defaulting to an `<h3>` (override with `titleAs`). */
|
|
34
37
|
function CardTitle(props) {
|
|
35
38
|
const { children, class: className, ref, titleAs: TitleTag = "h3", ...rest } = props;
|
|
36
39
|
const finalProps = mergeProps(rest, {
|
|
@@ -43,6 +46,7 @@ function CardTitle(props) {
|
|
|
43
46
|
children
|
|
44
47
|
});
|
|
45
48
|
}
|
|
49
|
+
/** Renders a {@link Card}'s supporting description text. */
|
|
46
50
|
function CardDescription(props) {
|
|
47
51
|
const { children, class: className, ref, ...rest } = props;
|
|
48
52
|
const finalProps = mergeProps(rest, {
|
|
@@ -55,6 +59,7 @@ function CardDescription(props) {
|
|
|
55
59
|
children
|
|
56
60
|
});
|
|
57
61
|
}
|
|
62
|
+
/** Renders the main content region of a {@link Card}. */
|
|
58
63
|
function CardContent(props) {
|
|
59
64
|
const { children, class: className, ref, ...rest } = props;
|
|
60
65
|
const finalProps = mergeProps(rest, {
|
|
@@ -67,6 +72,7 @@ function CardContent(props) {
|
|
|
67
72
|
children
|
|
68
73
|
});
|
|
69
74
|
}
|
|
75
|
+
/** Renders the footer region of a {@link Card}. */
|
|
70
76
|
function CardFooter(props) {
|
|
71
77
|
const { children, class: className, ref, ...rest } = props;
|
|
72
78
|
const finalProps = mergeProps(rest, {
|
|
@@ -79,6 +85,7 @@ function CardFooter(props) {
|
|
|
79
85
|
children
|
|
80
86
|
});
|
|
81
87
|
}
|
|
88
|
+
/** Renders an action/control region of a {@link Card}, typically positioned alongside the header. */
|
|
82
89
|
function CardAction(props) {
|
|
83
90
|
const { children, class: className, ref, ...rest } = props;
|
|
84
91
|
const finalProps = mergeProps(rest, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.js","names":[],"sources":["../../../src/components/card/card.tsx"],"sourcesContent":["import type { JSX } from \"@askrjs/askr/jsx-runtime\";\nimport { classes } from \"../_internal/classes\";\nimport { mergeProps } from \"../_internal/merge-props\";\nimport type {\n CardActionProps,\n CardContentProps,\n CardDescriptionProps,\n CardFooterProps,\n CardHeaderProps,\n CardProps,\n CardTitleProps,\n CardVariant,\n} from \"./card.types\";\n\nfunction normalizeVariant(variant: CardVariant | undefined) {\n return variant && variant !== \"default\" ? variant : undefined;\n}\n\nexport function Card(props: CardProps): JSX.Element {\n const { children, class: className, variant, ref, ...rest } = props;\n const normalizedVariant = normalizeVariant(variant);\n\n const finalProps = mergeProps(rest, {\n ref,\n class: classes(\"card\", normalizedVariant && `card-${normalizedVariant}`, className),\n \"data-slot\": \"card\",\n \"data-variant\": normalizedVariant,\n });\n\n return <div {...finalProps}>{children}</div>;\n}\n\nexport function CardHeader(props: CardHeaderProps): JSX.Element {\n const { children, class: className, ref, ...rest } = props;\n const finalProps = mergeProps(rest, {\n ref,\n class: classes(\"card-header\", className),\n \"data-slot\": \"card-header\",\n });\n\n return <div {...finalProps}>{children}</div>;\n}\n\nexport function CardTitle(props: CardTitleProps): JSX.Element {\n const { children, class: className, ref, titleAs: TitleTag = \"h3\", ...rest } = props;\n const finalProps = mergeProps(rest, {\n ref,\n class: classes(\"card-title\", className),\n \"data-slot\": \"card-title\",\n });\n\n return <TitleTag {...finalProps}>{children}</TitleTag>;\n}\n\nexport function CardDescription(props: CardDescriptionProps): JSX.Element {\n const { children, class: className, ref, ...rest } = props;\n const finalProps = mergeProps(rest, {\n ref,\n class: classes(\"card-description\", className),\n \"data-slot\": \"card-description\",\n });\n\n return <p {...finalProps}>{children}</p>;\n}\n\nexport function CardContent(props: CardContentProps): JSX.Element {\n const { children, class: className, ref, ...rest } = props;\n const finalProps = mergeProps(rest, {\n ref,\n class: classes(\"card-content\", className),\n \"data-slot\": \"card-content\",\n });\n\n return <div {...finalProps}>{children}</div>;\n}\n\nexport function CardFooter(props: CardFooterProps): JSX.Element {\n const { children, class: className, ref, ...rest } = props;\n const finalProps = mergeProps(rest, {\n ref,\n class: classes(\"card-footer\", className),\n \"data-slot\": \"card-footer\",\n });\n\n return <div {...finalProps}>{children}</div>;\n}\n\nexport function CardAction(props: CardActionProps): JSX.Element {\n const { children, class: className, ref, ...rest } = props;\n const finalProps = mergeProps(rest, {\n ref,\n class: classes(\"card-action\", className),\n \"data-slot\": \"card-action\",\n });\n\n return <div {...finalProps}>{children}</div>;\n}\n"],"mappings":";;;;AAcA,SAAS,iBAAiB,SAAkC;CAC1D,OAAO,WAAW,YAAY,YAAY,UAAU,KAAA;AACtD
|
|
1
|
+
{"version":3,"file":"card.js","names":[],"sources":["../../../src/components/card/card.tsx"],"sourcesContent":["import type { JSX } from \"@askrjs/askr/jsx-runtime\";\nimport { classes } from \"../_internal/classes\";\nimport { mergeProps } from \"../_internal/merge-props\";\nimport type {\n CardActionProps,\n CardContentProps,\n CardDescriptionProps,\n CardFooterProps,\n CardHeaderProps,\n CardProps,\n CardTitleProps,\n CardVariant,\n} from \"./card.types\";\n\nfunction normalizeVariant(variant: CardVariant | undefined) {\n return variant && variant !== \"default\" ? variant : undefined;\n}\n\n/** Root card container; applies the `card` class and an optional `variant` modifier. */\nexport function Card(props: CardProps): JSX.Element {\n const { children, class: className, variant, ref, ...rest } = props;\n const normalizedVariant = normalizeVariant(variant);\n\n const finalProps = mergeProps(rest, {\n ref,\n class: classes(\"card\", normalizedVariant && `card-${normalizedVariant}`, className),\n \"data-slot\": \"card\",\n \"data-variant\": normalizedVariant,\n });\n\n return <div {...finalProps}>{children}</div>;\n}\n\n/** Renders the header region of a {@link Card}. */\nexport function CardHeader(props: CardHeaderProps): JSX.Element {\n const { children, class: className, ref, ...rest } = props;\n const finalProps = mergeProps(rest, {\n ref,\n class: classes(\"card-header\", className),\n \"data-slot\": \"card-header\",\n });\n\n return <div {...finalProps}>{children}</div>;\n}\n\n/** Renders a {@link Card}'s title, defaulting to an `<h3>` (override with `titleAs`). */\nexport function CardTitle(props: CardTitleProps): JSX.Element {\n const { children, class: className, ref, titleAs: TitleTag = \"h3\", ...rest } = props;\n const finalProps = mergeProps(rest, {\n ref,\n class: classes(\"card-title\", className),\n \"data-slot\": \"card-title\",\n });\n\n return <TitleTag {...finalProps}>{children}</TitleTag>;\n}\n\n/** Renders a {@link Card}'s supporting description text. */\nexport function CardDescription(props: CardDescriptionProps): JSX.Element {\n const { children, class: className, ref, ...rest } = props;\n const finalProps = mergeProps(rest, {\n ref,\n class: classes(\"card-description\", className),\n \"data-slot\": \"card-description\",\n });\n\n return <p {...finalProps}>{children}</p>;\n}\n\n/** Renders the main content region of a {@link Card}. */\nexport function CardContent(props: CardContentProps): JSX.Element {\n const { children, class: className, ref, ...rest } = props;\n const finalProps = mergeProps(rest, {\n ref,\n class: classes(\"card-content\", className),\n \"data-slot\": \"card-content\",\n });\n\n return <div {...finalProps}>{children}</div>;\n}\n\n/** Renders the footer region of a {@link Card}. */\nexport function CardFooter(props: CardFooterProps): JSX.Element {\n const { children, class: className, ref, ...rest } = props;\n const finalProps = mergeProps(rest, {\n ref,\n class: classes(\"card-footer\", className),\n \"data-slot\": \"card-footer\",\n });\n\n return <div {...finalProps}>{children}</div>;\n}\n\n/** Renders an action/control region of a {@link Card}, typically positioned alongside the header. */\nexport function CardAction(props: CardActionProps): JSX.Element {\n const { children, class: className, ref, ...rest } = props;\n const finalProps = mergeProps(rest, {\n ref,\n class: classes(\"card-action\", className),\n \"data-slot\": \"card-action\",\n });\n\n return <div {...finalProps}>{children}</div>;\n}\n"],"mappings":";;;;AAcA,SAAS,iBAAiB,SAAkC;CAC1D,OAAO,WAAW,YAAY,YAAY,UAAU,KAAA;AACtD;;AAGA,SAAgB,KAAK,OAA+B;CAClD,MAAM,EAAE,UAAU,OAAO,WAAW,SAAS,KAAK,GAAG,SAAS;CAC9D,MAAM,oBAAoB,iBAAiB,OAAO;CAElD,MAAM,aAAa,WAAW,MAAM;EAClC;EACA,OAAO,QAAQ,QAAQ,qBAAqB,QAAQ,qBAAqB,SAAS;EAClF,aAAa;EACb,gBAAgB;CAClB,CAAC;CAED,OAAO,oBAAC,OAAD;EAAK,GAAI;EAAa;CAAc,CAAA;AAC7C;;AAGA,SAAgB,WA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