@lmb-it/kitsconcerto-native 0.1.247 → 0.1.248

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.
@@ -1 +1 @@
1
- {"version":3,"file":"SubmitButton.cjs","sources":["../../../../src/form-renderer/components/SubmitButton.tsx"],"sourcesContent":["import React, {isValidElement} from 'react';\nimport {Button} from \"../../_compat\";\nimport type {UseFormReturn} from \"react-hook-form\";\nimport type {IButtonProps, CustomSubmitButtonProps} from \"@lmb-it/kitsconcerto-types\";\n\ninterface SubmitButtonProps {\n isSubmitting: boolean;\n handleSubmit: () => void;\n submitButtonProps?: CustomSubmitButtonProps;\n formMethods: UseFormReturn<any>;\n}\n\nexport const SubmitButton = ({isSubmitting, handleSubmit, submitButtonProps, formMethods}: SubmitButtonProps) => {\n // Function → render prop\n if (typeof submitButtonProps === \"function\") {\n return <>{submitButtonProps(handleSubmit, isSubmitting, formMethods)}</>;\n }\n\n // ReactElement → render directly\n if (isValidElement(submitButtonProps)) {\n return submitButtonProps;\n }\n\n // Object or undefined → merge with defaults and render Button\n // NOTE: severity intentionally omitted — the underlying <Button> defaults\n // to 'brand', which means the form's primary CTA picks up the configured\n // theme primary color (e.g. teal in the AlphaMatch standalone theme)\n // without each consumer having to pass `severity: 'brand'` explicitly.\n // Was previously `severity: 'secondary'` which produced a grey button on\n // every form regardless of theme — non-standard for a primary action.\n const props: Omit<IButtonProps<any>, \"onClick\"> = {\n label: \"Submit\",\n isLoadingText: \"Please Wait...\",\n ...(submitButtonProps && typeof submitButtonProps === \"object\" ? submitButtonProps : {}),\n };\n\n return (\n <Button\n {...props}\n onClick={handleSubmit}\n loading={isSubmitting}\n disabled={isSubmitting}\n />\n );\n};\n"],"names":["jsx","Fragment","isValidElement","Button"],"mappings":";;;;;;AAYO,MAAM,eAAe,CAAC,EAAC,cAAc,YAAA,EAAc,iBAAA,EAAmB,aAAW,KAAyB;AAE7G,EAAA,IAAI,OAAO,sBAAsB,UAAA,EAAY;AACzC,IAAA,uBAAOA,cAAA,CAAAC,mBAAA,EAAA,EAAG,QAAA,EAAA,iBAAA,CAAkB,YAAA,EAAc,YAAA,EAAc,WAAW,CAAA,EAAE,CAAA;AAAA,EACzE;AAGA,EAAA,IAAIC,oBAAA,CAAe,iBAAiB,CAAA,EAAG;AACnC,IAAA,OAAO,iBAAA;AAAA,EACX;AASA,EAAA,MAAM,KAAA,GAA4C;AAAA,IAC9C,KAAA,EAAO,QAAA;AAAA,IACP,aAAA,EAAe,gBAAA;AAAA,IACf,GAAI,iBAAA,IAAqB,OAAO,iBAAA,KAAsB,QAAA,GAAW,oBAAoB;AAAC,GAC1F;AAEA,EAAA,uBACIF,cAAA;AAAA,IAACG,oBAAA;AAAA,IAAA;AAAA,MACI,GAAG,KAAA;AAAA,MACJ,OAAA,EAAS,YAAA;AAAA,MACT,OAAA,EAAS,YAAA;AAAA,MACT,QAAA,EAAU;AAAA;AAAA,GACd;AAER;;;;"}
1
+ {"version":3,"file":"SubmitButton.cjs","sources":["../../../../src/form-renderer/components/SubmitButton.tsx"],"sourcesContent":["import React, {isValidElement} from 'react';\nimport {Button} from \"../../_compat\";\nimport type {UseFormReturn} from \"react-hook-form\";\nimport type {IButtonProps, CustomSubmitButtonProps} from \"@lmb-it/kitsconcerto-types\";\n\ninterface SubmitButtonProps {\n isSubmitting: boolean;\n handleSubmit: () => void;\n submitButtonProps?: CustomSubmitButtonProps;\n formMethods: UseFormReturn<any>;\n}\n\nexport const SubmitButton = ({isSubmitting, handleSubmit, submitButtonProps, formMethods}: SubmitButtonProps) => {\n // Function → render prop\n if (typeof submitButtonProps === \"function\") {\n return <>{submitButtonProps(handleSubmit, isSubmitting, formMethods)}</>;\n }\n\n // ReactElement → render directly\n if (isValidElement(submitButtonProps)) {\n return submitButtonProps;\n }\n\n // Object or undefined → merge with defaults and render Button\n // NOTE: severity intentionally omitted — the underlying <Button> defaults\n // to 'brand', which means the form's primary CTA picks up the configured\n // theme primary color (e.g. teal in the AlphaMatch standalone theme)\n // without each consumer having to pass `severity: 'brand'` explicitly.\n // Was previously `severity: 'secondary'` which produced a grey button on\n // every form regardless of theme — non-standard for a primary action.\n // Type-only alignment with CustomSubmitButtonProps: loading/disabled are\n // excluded from the consumer surface because the JSX below always renders\n // them from isSubmitting (deliberate runtime behaviour, unchanged).\n const props: Omit<IButtonProps<any>, \"onClick\" | \"loading\" | \"disabled\"> = {\n label: \"Submit\",\n isLoadingText: \"Please Wait...\",\n ...(submitButtonProps && typeof submitButtonProps === \"object\" ? submitButtonProps : {}),\n };\n\n return (\n <Button\n {...props}\n onClick={handleSubmit}\n loading={isSubmitting}\n disabled={isSubmitting}\n />\n );\n};\n"],"names":["jsx","Fragment","isValidElement","Button"],"mappings":";;;;;;AAYO,MAAM,eAAe,CAAC,EAAC,cAAc,YAAA,EAAc,iBAAA,EAAmB,aAAW,KAAyB;AAE7G,EAAA,IAAI,OAAO,sBAAsB,UAAA,EAAY;AACzC,IAAA,uBAAOA,cAAA,CAAAC,mBAAA,EAAA,EAAG,QAAA,EAAA,iBAAA,CAAkB,YAAA,EAAc,YAAA,EAAc,WAAW,CAAA,EAAE,CAAA;AAAA,EACzE;AAGA,EAAA,IAAIC,oBAAA,CAAe,iBAAiB,CAAA,EAAG;AACnC,IAAA,OAAO,iBAAA;AAAA,EACX;AAYA,EAAA,MAAM,KAAA,GAAqE;AAAA,IACvE,KAAA,EAAO,QAAA;AAAA,IACP,aAAA,EAAe,gBAAA;AAAA,IACf,GAAI,iBAAA,IAAqB,OAAO,iBAAA,KAAsB,QAAA,GAAW,oBAAoB;AAAC,GAC1F;AAEA,EAAA,uBACIF,cAAA;AAAA,IAACG,oBAAA;AAAA,IAAA;AAAA,MACI,GAAG,KAAA;AAAA,MACJ,OAAA,EAAS,YAAA;AAAA,MACT,OAAA,EAAS,YAAA;AAAA,MACT,QAAA,EAAU;AAAA;AAAA,GACd;AAER;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SubmitButton.js","sources":["../../../../src/form-renderer/components/SubmitButton.tsx"],"sourcesContent":["import React, {isValidElement} from 'react';\nimport {Button} from \"../../_compat\";\nimport type {UseFormReturn} from \"react-hook-form\";\nimport type {IButtonProps, CustomSubmitButtonProps} from \"@lmb-it/kitsconcerto-types\";\n\ninterface SubmitButtonProps {\n isSubmitting: boolean;\n handleSubmit: () => void;\n submitButtonProps?: CustomSubmitButtonProps;\n formMethods: UseFormReturn<any>;\n}\n\nexport const SubmitButton = ({isSubmitting, handleSubmit, submitButtonProps, formMethods}: SubmitButtonProps) => {\n // Function → render prop\n if (typeof submitButtonProps === \"function\") {\n return <>{submitButtonProps(handleSubmit, isSubmitting, formMethods)}</>;\n }\n\n // ReactElement → render directly\n if (isValidElement(submitButtonProps)) {\n return submitButtonProps;\n }\n\n // Object or undefined → merge with defaults and render Button\n // NOTE: severity intentionally omitted — the underlying <Button> defaults\n // to 'brand', which means the form's primary CTA picks up the configured\n // theme primary color (e.g. teal in the AlphaMatch standalone theme)\n // without each consumer having to pass `severity: 'brand'` explicitly.\n // Was previously `severity: 'secondary'` which produced a grey button on\n // every form regardless of theme — non-standard for a primary action.\n const props: Omit<IButtonProps<any>, \"onClick\"> = {\n label: \"Submit\",\n isLoadingText: \"Please Wait...\",\n ...(submitButtonProps && typeof submitButtonProps === \"object\" ? submitButtonProps : {}),\n };\n\n return (\n <Button\n {...props}\n onClick={handleSubmit}\n loading={isSubmitting}\n disabled={isSubmitting}\n />\n );\n};\n"],"names":[],"mappings":";;;;AAYO,MAAM,eAAe,CAAC,EAAC,cAAc,YAAA,EAAc,iBAAA,EAAmB,aAAW,KAAyB;AAE7G,EAAA,IAAI,OAAO,sBAAsB,UAAA,EAAY;AACzC,IAAA,uBAAO,GAAA,CAAA,QAAA,EAAA,EAAG,QAAA,EAAA,iBAAA,CAAkB,YAAA,EAAc,YAAA,EAAc,WAAW,CAAA,EAAE,CAAA;AAAA,EACzE;AAGA,EAAA,IAAI,cAAA,CAAe,iBAAiB,CAAA,EAAG;AACnC,IAAA,OAAO,iBAAA;AAAA,EACX;AASA,EAAA,MAAM,KAAA,GAA4C;AAAA,IAC9C,KAAA,EAAO,QAAA;AAAA,IACP,aAAA,EAAe,gBAAA;AAAA,IACf,GAAI,iBAAA,IAAqB,OAAO,iBAAA,KAAsB,QAAA,GAAW,oBAAoB;AAAC,GAC1F;AAEA,EAAA,uBACI,GAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACI,GAAG,KAAA;AAAA,MACJ,OAAA,EAAS,YAAA;AAAA,MACT,OAAA,EAAS,YAAA;AAAA,MACT,QAAA,EAAU;AAAA;AAAA,GACd;AAER;;;;"}
1
+ {"version":3,"file":"SubmitButton.js","sources":["../../../../src/form-renderer/components/SubmitButton.tsx"],"sourcesContent":["import React, {isValidElement} from 'react';\nimport {Button} from \"../../_compat\";\nimport type {UseFormReturn} from \"react-hook-form\";\nimport type {IButtonProps, CustomSubmitButtonProps} from \"@lmb-it/kitsconcerto-types\";\n\ninterface SubmitButtonProps {\n isSubmitting: boolean;\n handleSubmit: () => void;\n submitButtonProps?: CustomSubmitButtonProps;\n formMethods: UseFormReturn<any>;\n}\n\nexport const SubmitButton = ({isSubmitting, handleSubmit, submitButtonProps, formMethods}: SubmitButtonProps) => {\n // Function → render prop\n if (typeof submitButtonProps === \"function\") {\n return <>{submitButtonProps(handleSubmit, isSubmitting, formMethods)}</>;\n }\n\n // ReactElement → render directly\n if (isValidElement(submitButtonProps)) {\n return submitButtonProps;\n }\n\n // Object or undefined → merge with defaults and render Button\n // NOTE: severity intentionally omitted — the underlying <Button> defaults\n // to 'brand', which means the form's primary CTA picks up the configured\n // theme primary color (e.g. teal in the AlphaMatch standalone theme)\n // without each consumer having to pass `severity: 'brand'` explicitly.\n // Was previously `severity: 'secondary'` which produced a grey button on\n // every form regardless of theme — non-standard for a primary action.\n // Type-only alignment with CustomSubmitButtonProps: loading/disabled are\n // excluded from the consumer surface because the JSX below always renders\n // them from isSubmitting (deliberate runtime behaviour, unchanged).\n const props: Omit<IButtonProps<any>, \"onClick\" | \"loading\" | \"disabled\"> = {\n label: \"Submit\",\n isLoadingText: \"Please Wait...\",\n ...(submitButtonProps && typeof submitButtonProps === \"object\" ? submitButtonProps : {}),\n };\n\n return (\n <Button\n {...props}\n onClick={handleSubmit}\n loading={isSubmitting}\n disabled={isSubmitting}\n />\n );\n};\n"],"names":[],"mappings":";;;;AAYO,MAAM,eAAe,CAAC,EAAC,cAAc,YAAA,EAAc,iBAAA,EAAmB,aAAW,KAAyB;AAE7G,EAAA,IAAI,OAAO,sBAAsB,UAAA,EAAY;AACzC,IAAA,uBAAO,GAAA,CAAA,QAAA,EAAA,EAAG,QAAA,EAAA,iBAAA,CAAkB,YAAA,EAAc,YAAA,EAAc,WAAW,CAAA,EAAE,CAAA;AAAA,EACzE;AAGA,EAAA,IAAI,cAAA,CAAe,iBAAiB,CAAA,EAAG;AACnC,IAAA,OAAO,iBAAA;AAAA,EACX;AAYA,EAAA,MAAM,KAAA,GAAqE;AAAA,IACvE,KAAA,EAAO,QAAA;AAAA,IACP,aAAA,EAAe,gBAAA;AAAA,IACf,GAAI,iBAAA,IAAqB,OAAO,iBAAA,KAAsB,QAAA,GAAW,oBAAoB;AAAC,GAC1F;AAEA,EAAA,uBACI,GAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACI,GAAG,KAAA;AAAA,MACJ,OAAA,EAAS,YAAA;AAAA,MACT,OAAA,EAAS,YAAA;AAAA,MACT,QAAA,EAAU;AAAA;AAAA,GACd;AAER;;;;"}
@@ -110,6 +110,7 @@ const ELEMENT_SLOT_KEYS = /* @__PURE__ */ new Set([
110
110
  "paginatorPageReport",
111
111
  "paginatorRowsPerPage",
112
112
  "paginatorRowsPerPageDropdown",
113
+ "paginatorPages",
113
114
  "sortedColumn",
114
115
  "stripedRow",
115
116
  "selectedRow",
@@ -121,6 +122,15 @@ const ELEMENT_SLOT_KEYS = /* @__PURE__ */ new Set([
121
122
  "toolbarButton",
122
123
  "clearFilterButton",
123
124
  "columnPicker",
125
+ // Toolbar sizing + placeholder, and the chrome the table renders itself.
126
+ // NOTE: a slot missing from this allowlist is silently dropped — theming
127
+ // it has no effect at all — so every new slot must be listed here as
128
+ // well as in its component's ITableElementSlots.
129
+ "toolbarControl",
130
+ "filterPlaceholder",
131
+ "topBar",
132
+ "bulkBar",
133
+ "bulkBarText",
124
134
  // Accordion
125
135
  "headerActive",
126
136
  "headerHover",
@@ -1 +1 @@
1
- {"version":3,"file":"useComponentDefaults.cjs","sources":["../../../src/hooks/useComponentDefaults.ts"],"sourcesContent":["import {useMemo} from 'react';\nimport {useKitsTheme} from '../contexts/Theme';\n\n/**\n * Known element slot keys. When a config key matches one of these\n * AND the value has `props` or `style`, it is treated as an element slot.\n *\n * To add a new slot: add the key here AND to the relevant slot interface\n * in packages/types/src/Theme/types.ts (and to the `AllSlotKeys` union).\n *\n * The order below mirrors the typed slot hierarchy in\n * `packages/types/src/Theme/types.ts`.\n */\nconst ELEMENT_SLOT_KEYS = new Set([\n // ── Form-element slots ──────────────────────────────────\n // Base (all form elements — IFormElementBaseSlots)\n 'label', 'helperText', 'error',\n // Text input specific (ITextInputSlots — also shared by ISelectSlots)\n 'root', 'container', 'inputGroup', 'leftAddon', 'rightAddon',\n // Select specific (ISelectSlots — option-list popover)\n // Radio / Checkbox also use `item` / `itemSelected` / `itemDisabled` /\n // `itemHover` for the per-list-item wrapper, plus `itemInvalid`.\n 'panel', 'item', 'itemSelected', 'itemFocused', 'itemHover', 'itemDisabled', 'itemInvalid',\n // MultiSelect specific (IMultiSelectSlots — chips + per-item checkbox)\n 'token', 'tokenIcon',\n 'checkboxBox', 'checkboxBoxChecked', 'checkboxIcon',\n // Datepicker specific (IDatepickerSlots — calendar popup; `panel` shared with Select)\n 'calendarHeader', 'calendarNavButton', 'weekDay',\n 'dayCell', 'daySelected', 'dayToday', 'dayDisabled',\n // Switch specific (ISwitchSlots) — RENAMED from slider/sliderChecked/thumbChecked\n 'track', 'trackOn', 'thumb', 'thumbOn',\n // Checkbox specific (ICheckboxSlots)\n 'box', 'boxChecked', 'checkIcon',\n // Radio specific (IRadioSlots)\n 'circle', 'circleInner',\n // Radio + Checkbox: wrapper Flex around all list items\n 'itemsContainer',\n\n // ── Non-form component slots (untouched by the form-element refactor) ──\n // Card / Button / generic\n 'icon', 'header', 'title', 'subTitle', 'content', 'footer',\n // Button variants — `text` applies only to buttons with a label,\n // `iconOnly` applies only to icon-only buttons (so styling one never\n // affects the other).\n 'text', 'iconOnly',\n // Table\n 'th', 'headerRow', 'headerCell', 'body', 'bodyRow', 'bodyCell',\n 'wrapper', 'table', 'tbody',\n 'filterRow', 'filterCell', 'filterClearButton',\n 'columnFilter', 'columnFilterInput',\n 'tfoot', 'footerRow', 'footerCell', 'footer', 'paginator', 'emptyMessage',\n 'loadingOverlay', 'loadingIcon',\n 'rowGroupHeader', 'rowGroupHeaderName', 'rowExpansion', 'rowGroupFooter',\n 'rowGroupToggler', 'rowGroupTogglerIcon',\n 'resizeHelper',\n 'reorderIndicatorUp', 'reorderIndicatorUpIcon',\n 'reorderIndicatorDown', 'reorderIndicatorDownIcon',\n 'tableHeader', 'searchInput',\n 'paginatorPageButton', 'paginatorPageLink', 'paginatorActivePageButton',\n 'paginatorPageReport', 'paginatorRowsPerPage', 'paginatorRowsPerPageDropdown',\n 'sortedColumn', 'stripedRow', 'selectedRow', 'selectedRowAccent',\n 'filterBar', 'filterInput', 'filterLabel',\n 'toolbarRight', 'toolbarButton', 'clearFilterButton', 'columnPicker',\n // Accordion\n 'headerActive', 'headerHover',\n // Sidebar/Drawer\n 'headerTitle', 'closeButton', 'mask',\n // Group (repeatable field array)\n 'row', 'addButton', 'removeButton',\n // Header (app-shell top bar)\n 'toggleModeButton', 'avatarButton', 'breadcrumb',\n]);\n\nexport interface IElementConfig {\n style: Record<string, any>;\n important?: boolean | string[];\n pseudo?: Record<string, Record<string, any>>;\n}\n\nexport interface UseComponentDefaultsResult<T> {\n /** Props with theme defaults merged in (user props always win) */\n mergedProps: T;\n /**\n * CSS style from root slot — backwards compat for components\n * that read themeStyle instead of elementStyles.root\n */\n themeStyle: Record<string, any>;\n /**\n * Per-element style maps. Each key is a slot name, value is the\n * merged IStyleClasses (not yet resolved to CSSProperties).\n * Use `useResolvedElementStyles(elementStyles)` to resolve.\n */\n elementStyles: Record<string, Record<string, any>>;\n /**\n * Full slot configs including `important` and `pseudo` fields.\n * Use this instead of `elementStyles` when you need those fields.\n */\n elementConfigs: Record<string, IElementConfig>;\n}\n\n/**\n * Merges theme-level component defaults with user-supplied props.\n *\n * Resolution chain (lowest → highest priority):\n * FormElement[slot] < baseGroup[slot] < component[slot] < instanceSlots[slot] < user props\n *\n * `FormElement` is the global base group for every form element\n * (label / helperText / error live there by default). It is applied\n * to every component regardless of whether a `baseGroup` is provided\n * — for non-form components like Button or Card, FormElement slots\n * are no-ops in practice because those components don't read\n * `elementStyles.label` / `helperText` / `error`.\n *\n * Element slots (`root`, `label`, `container`, etc.) are direct keys\n * on the component config. Each slot accepts `{ props?, style? }`.\n *\n * The `root` slot's `props` are merged into `mergedProps` alongside\n * user props (user always wins). The `root` slot's `style` is returned\n * as both `themeStyle` (backwards compat) and `elementStyles.root`.\n *\n * Supports base-group inheritance: e.g. `useComponentDefaults('InputText', rawProps, 'Input')`\n * merges FormElement first, then Input base, then InputText overrides,\n * then per-instance slots, then user props.\n *\n * @example\n * const { mergedProps, themeStyle, elementStyles } = useComponentDefaults('InputText', rawProps, 'Input');\n * // mergedProps → FormElement.root.props < Input.root.props < InputText.root.props < instanceSlots < user props\n * // elementStyles.label → FormElement.label.style < Input.label.style < InputText.label.style < instance label\n * // elementStyles.root → root element style (FormElement → Input → InputText → instance)\n * // elementStyles.container → container element style\n */\nexport default function useComponentDefaults<T extends Record<string, any>>(\n componentName: string,\n props: T,\n baseGroup?: string,\n): UseComponentDefaultsResult<T> {\n const {theme} = useKitsTheme();\n // Global base for every form element. Always looked up — if not\n // configured it is `undefined` and the merge contributes nothing.\n const formElementConfig = theme.components.FormElement;\n const baseConfig = baseGroup ? theme.components[baseGroup] : undefined;\n const config = theme.components[componentName];\n\n return useMemo(() => {\n // Extract per-instance slot overrides from props (IFormElement.slots passed through)\n const instanceSlots = (props as any).slots as Record<string, { props?: any; style?: any; important?: boolean | string[]; pseudo?: Record<string, Record<string, any>> }> | undefined;\n\n if (!config && !baseConfig && !instanceSlots && !formElementConfig) {\n return {mergedProps: props, themeStyle: {}, elementStyles: {}, elementConfigs: {}};\n }\n\n const formBase = (formElementConfig || {}) as Record<string, any>;\n const base = (baseConfig || {}) as Record<string, any>;\n const comp = (config || {}) as Record<string, any>;\n\n // --- Props merge: FormElement.root.props < base.root.props < config.root.props < instanceSlots.root.props < user props ---\n const merged = {\n ...(formBase.root?.props || {}),\n ...(base.root?.props || {}),\n ...(comp.root?.props || {}),\n ...(instanceSlots?.root?.props || {}),\n } as Record<string, any>;\n\n for (const key of Object.keys(props)) {\n // Skip 'slots' — it is consumed here, not forwarded\n if (key === 'slots') continue;\n if (props[key] !== undefined) {\n merged[key] = props[key];\n }\n }\n\n // --- Element styles merge: FormElement[slot] < base[slot] < config[slot] < instanceSlots[slot] ---\n const allSlotKeys = new Set<string>();\n for (const key of Object.keys(formBase)) {\n if (ELEMENT_SLOT_KEYS.has(key)) allSlotKeys.add(key);\n }\n for (const key of Object.keys(base)) {\n if (ELEMENT_SLOT_KEYS.has(key)) allSlotKeys.add(key);\n }\n for (const key of Object.keys(comp)) {\n if (ELEMENT_SLOT_KEYS.has(key)) allSlotKeys.add(key);\n }\n if (instanceSlots) {\n for (const key of Object.keys(instanceSlots)) {\n if (ELEMENT_SLOT_KEYS.has(key)) allSlotKeys.add(key);\n }\n }\n\n const elementStyles: Record<string, Record<string, any>> = {};\n const elementConfigs: Record<string, IElementConfig> = {};\n for (const slotKey of allSlotKeys) {\n const style = {\n ...(formBase[slotKey]?.style || {}),\n ...(base[slotKey]?.style || {}),\n ...(comp[slotKey]?.style || {}),\n ...(instanceSlots?.[slotKey]?.style || {}),\n };\n elementStyles[slotKey] = style;\n\n const pseudoMerged = {\n ...(formBase[slotKey]?.pseudo || {}),\n ...(base[slotKey]?.pseudo || {}),\n ...(comp[slotKey]?.pseudo || {}),\n ...(instanceSlots?.[slotKey]?.pseudo || {}),\n };\n elementConfigs[slotKey] = {\n style,\n important:\n instanceSlots?.[slotKey]?.important ??\n comp[slotKey]?.important ??\n base[slotKey]?.important ??\n formBase[slotKey]?.important,\n pseudo: Object.keys(pseudoMerged).length > 0 ? pseudoMerged : undefined,\n };\n }\n\n // themeStyle = root element style (backwards compat)\n const themeStyle = elementStyles.root || {};\n\n return {\n mergedProps: merged as T,\n themeStyle,\n elementStyles,\n elementConfigs,\n };\n }, [formElementConfig, baseConfig, config, props]);\n}\n"],"names":["useKitsTheme","useMemo"],"mappings":";;;;;;;AAaA,MAAM,iBAAA,uBAAwB,GAAA,CAAI;AAAA;AAAA;AAAA,EAG9B,OAAA;AAAA,EAAS,YAAA;AAAA,EAAc,OAAA;AAAA;AAAA,EAEvB,MAAA;AAAA,EAAQ,WAAA;AAAA,EAAa,YAAA;AAAA,EAAc,WAAA;AAAA,EAAa,YAAA;AAAA;AAAA;AAAA;AAAA,EAIhD,OAAA;AAAA,EAAS,MAAA;AAAA,EAAQ,cAAA;AAAA,EAAgB,aAAA;AAAA,EAAe,WAAA;AAAA,EAAa,cAAA;AAAA,EAAgB,aAAA;AAAA;AAAA,EAE7E,OAAA;AAAA,EAAS,WAAA;AAAA,EACT,aAAA;AAAA,EAAe,oBAAA;AAAA,EAAsB,cAAA;AAAA;AAAA,EAErC,gBAAA;AAAA,EAAkB,mBAAA;AAAA,EAAqB,SAAA;AAAA,EACvC,SAAA;AAAA,EAAW,aAAA;AAAA,EAAe,UAAA;AAAA,EAAY,aAAA;AAAA;AAAA,EAEtC,OAAA;AAAA,EAAS,SAAA;AAAA,EAAW,OAAA;AAAA,EAAS,SAAA;AAAA;AAAA,EAE7B,KAAA;AAAA,EAAO,YAA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rD;;;;"}
1
+ {"version":3,"file":"useComponentDefaults.cjs","sources":["../../../src/hooks/useComponentDefaults.ts"],"sourcesContent":["import {useMemo} from 'react';\nimport {useKitsTheme} from '../contexts/Theme';\n\n/**\n * Known element slot keys. When a config key matches one of these\n * AND the value has `props` or `style`, it is treated as an element slot.\n *\n * To add a new slot: add the key here AND to the relevant slot interface\n * in packages/types/src/Theme/types.ts (and to the `AllSlotKeys` union).\n *\n * The order below mirrors the typed slot hierarchy in\n * `packages/types/src/Theme/types.ts`.\n */\nconst ELEMENT_SLOT_KEYS = new Set([\n // ── Form-element slots ──────────────────────────────────\n // Base (all form elements — IFormElementBaseSlots)\n 'label', 'helperText', 'error',\n // Text input specific (ITextInputSlots — also shared by ISelectSlots)\n 'root', 'container', 'inputGroup', 'leftAddon', 'rightAddon',\n // Select specific (ISelectSlots — option-list popover)\n // Radio / Checkbox also use `item` / `itemSelected` / `itemDisabled` /\n // `itemHover` for the per-list-item wrapper, plus `itemInvalid`.\n 'panel', 'item', 'itemSelected', 'itemFocused', 'itemHover', 'itemDisabled', 'itemInvalid',\n // MultiSelect specific (IMultiSelectSlots — chips + per-item checkbox)\n 'token', 'tokenIcon',\n 'checkboxBox', 'checkboxBoxChecked', 'checkboxIcon',\n // Datepicker specific (IDatepickerSlots — calendar popup; `panel` shared with Select)\n 'calendarHeader', 'calendarNavButton', 'weekDay',\n 'dayCell', 'daySelected', 'dayToday', 'dayDisabled',\n // Switch specific (ISwitchSlots) — RENAMED from slider/sliderChecked/thumbChecked\n 'track', 'trackOn', 'thumb', 'thumbOn',\n // Checkbox specific (ICheckboxSlots)\n 'box', 'boxChecked', 'checkIcon',\n // Radio specific (IRadioSlots)\n 'circle', 'circleInner',\n // Radio + Checkbox: wrapper Flex around all list items\n 'itemsContainer',\n\n // ── Non-form component slots (untouched by the form-element refactor) ──\n // Card / Button / generic\n 'icon', 'header', 'title', 'subTitle', 'content', 'footer',\n // Button variants — `text` applies only to buttons with a label,\n // `iconOnly` applies only to icon-only buttons (so styling one never\n // affects the other).\n 'text', 'iconOnly',\n // Table\n 'th', 'headerRow', 'headerCell', 'body', 'bodyRow', 'bodyCell',\n 'wrapper', 'table', 'tbody',\n 'filterRow', 'filterCell', 'filterClearButton',\n 'columnFilter', 'columnFilterInput',\n 'tfoot', 'footerRow', 'footerCell', 'footer', 'paginator', 'emptyMessage',\n 'loadingOverlay', 'loadingIcon',\n 'rowGroupHeader', 'rowGroupHeaderName', 'rowExpansion', 'rowGroupFooter',\n 'rowGroupToggler', 'rowGroupTogglerIcon',\n 'resizeHelper',\n 'reorderIndicatorUp', 'reorderIndicatorUpIcon',\n 'reorderIndicatorDown', 'reorderIndicatorDownIcon',\n 'tableHeader', 'searchInput',\n 'paginatorPageButton', 'paginatorPageLink', 'paginatorActivePageButton',\n 'paginatorPageReport', 'paginatorRowsPerPage', 'paginatorRowsPerPageDropdown',\n 'paginatorPages',\n 'sortedColumn', 'stripedRow', 'selectedRow', 'selectedRowAccent',\n 'filterBar', 'filterInput', 'filterLabel',\n 'toolbarRight', 'toolbarButton', 'clearFilterButton', 'columnPicker',\n // Toolbar sizing + placeholder, and the chrome the table renders itself.\n // NOTE: a slot missing from this allowlist is silently dropped — theming\n // it has no effect at all — so every new slot must be listed here as\n // well as in its component's ITableElementSlots.\n 'toolbarControl', 'filterPlaceholder',\n 'topBar', 'bulkBar', 'bulkBarText',\n // Accordion\n 'headerActive', 'headerHover',\n // Sidebar/Drawer\n 'headerTitle', 'closeButton', 'mask',\n // Group (repeatable field array)\n 'row', 'addButton', 'removeButton',\n // Header (app-shell top bar)\n 'toggleModeButton', 'avatarButton', 'breadcrumb',\n]);\n\nexport interface IElementConfig {\n style: Record<string, any>;\n important?: boolean | string[];\n pseudo?: Record<string, Record<string, any>>;\n}\n\nexport interface UseComponentDefaultsResult<T> {\n /** Props with theme defaults merged in (user props always win) */\n mergedProps: T;\n /**\n * CSS style from root slot — backwards compat for components\n * that read themeStyle instead of elementStyles.root\n */\n themeStyle: Record<string, any>;\n /**\n * Per-element style maps. Each key is a slot name, value is the\n * merged IStyleClasses (not yet resolved to CSSProperties).\n * Use `useResolvedElementStyles(elementStyles)` to resolve.\n */\n elementStyles: Record<string, Record<string, any>>;\n /**\n * Full slot configs including `important` and `pseudo` fields.\n * Use this instead of `elementStyles` when you need those fields.\n */\n elementConfigs: Record<string, IElementConfig>;\n}\n\n/**\n * Merges theme-level component defaults with user-supplied props.\n *\n * Resolution chain (lowest → highest priority):\n * FormElement[slot] < baseGroup[slot] < component[slot] < instanceSlots[slot] < user props\n *\n * `FormElement` is the global base group for every form element\n * (label / helperText / error live there by default). It is applied\n * to every component regardless of whether a `baseGroup` is provided\n * — for non-form components like Button or Card, FormElement slots\n * are no-ops in practice because those components don't read\n * `elementStyles.label` / `helperText` / `error`.\n *\n * Element slots (`root`, `label`, `container`, etc.) are direct keys\n * on the component config. Each slot accepts `{ props?, style? }`.\n *\n * The `root` slot's `props` are merged into `mergedProps` alongside\n * user props (user always wins). The `root` slot's `style` is returned\n * as both `themeStyle` (backwards compat) and `elementStyles.root`.\n *\n * Supports base-group inheritance: e.g. `useComponentDefaults('InputText', rawProps, 'Input')`\n * merges FormElement first, then Input base, then InputText overrides,\n * then per-instance slots, then user props.\n *\n * @example\n * const { mergedProps, themeStyle, elementStyles } = useComponentDefaults('InputText', rawProps, 'Input');\n * // mergedProps → FormElement.root.props < Input.root.props < InputText.root.props < instanceSlots < user props\n * // elementStyles.label → FormElement.label.style < Input.label.style < InputText.label.style < instance label\n * // elementStyles.root → root element style (FormElement → Input → InputText → instance)\n * // elementStyles.container → container element style\n */\nexport default function useComponentDefaults<T extends Record<string, any>>(\n componentName: string,\n props: T,\n baseGroup?: string,\n): UseComponentDefaultsResult<T> {\n const {theme} = useKitsTheme();\n // Global base for every form element. Always looked up — if not\n // configured it is `undefined` and the merge contributes nothing.\n const formElementConfig = theme.components.FormElement;\n const baseConfig = baseGroup ? theme.components[baseGroup] : undefined;\n const config = theme.components[componentName];\n\n return useMemo(() => {\n // Extract per-instance slot overrides from props (IFormElement.slots passed through)\n const instanceSlots = (props as any).slots as Record<string, { props?: any; style?: any; important?: boolean | string[]; pseudo?: Record<string, Record<string, any>> }> | undefined;\n\n if (!config && !baseConfig && !instanceSlots && !formElementConfig) {\n return {mergedProps: props, themeStyle: {}, elementStyles: {}, elementConfigs: {}};\n }\n\n const formBase = (formElementConfig || {}) as Record<string, any>;\n const base = (baseConfig || {}) as Record<string, any>;\n const comp = (config || {}) as Record<string, any>;\n\n // --- Props merge: FormElement.root.props < base.root.props < config.root.props < instanceSlots.root.props < user props ---\n const merged = {\n ...(formBase.root?.props || {}),\n ...(base.root?.props || {}),\n ...(comp.root?.props || {}),\n ...(instanceSlots?.root?.props || {}),\n } as Record<string, any>;\n\n for (const key of Object.keys(props)) {\n // Skip 'slots' — it is consumed here, not forwarded\n if (key === 'slots') continue;\n if (props[key] !== undefined) {\n merged[key] = props[key];\n }\n }\n\n // --- Element styles merge: FormElement[slot] < base[slot] < config[slot] < instanceSlots[slot] ---\n const allSlotKeys = new Set<string>();\n for (const key of Object.keys(formBase)) {\n if (ELEMENT_SLOT_KEYS.has(key)) allSlotKeys.add(key);\n }\n for (const key of Object.keys(base)) {\n if (ELEMENT_SLOT_KEYS.has(key)) allSlotKeys.add(key);\n }\n for (const key of Object.keys(comp)) {\n if (ELEMENT_SLOT_KEYS.has(key)) allSlotKeys.add(key);\n }\n if (instanceSlots) {\n for (const key of Object.keys(instanceSlots)) {\n if (ELEMENT_SLOT_KEYS.has(key)) allSlotKeys.add(key);\n }\n }\n\n const elementStyles: Record<string, Record<string, any>> = {};\n const elementConfigs: Record<string, IElementConfig> = {};\n for (const slotKey of allSlotKeys) {\n const style = {\n ...(formBase[slotKey]?.style || {}),\n ...(base[slotKey]?.style || {}),\n ...(comp[slotKey]?.style || {}),\n ...(instanceSlots?.[slotKey]?.style || {}),\n };\n elementStyles[slotKey] = style;\n\n const pseudoMerged = {\n ...(formBase[slotKey]?.pseudo || {}),\n ...(base[slotKey]?.pseudo || {}),\n ...(comp[slotKey]?.pseudo || {}),\n ...(instanceSlots?.[slotKey]?.pseudo || {}),\n };\n elementConfigs[slotKey] = {\n style,\n important:\n instanceSlots?.[slotKey]?.important ??\n comp[slotKey]?.important ??\n base[slotKey]?.important ??\n formBase[slotKey]?.important,\n pseudo: Object.keys(pseudoMerged).length > 0 ? pseudoMerged : undefined,\n };\n }\n\n // themeStyle = root element style (backwards compat)\n const themeStyle = elementStyles.root || {};\n\n return {\n mergedProps: merged as T,\n themeStyle,\n elementStyles,\n elementConfigs,\n };\n }, [formElementConfig, baseConfig, config, props]);\n}\n"],"names":["useKitsTheme","useMemo"],"mappings":";;;;;;;AAaA,MAAM,iBAAA,uBAAwB,GAAA,CAAI;AAAA;AAAA;AAAA,EAG9B,OAAA;AAAA,EAAS,YAAA;AAAA,EAAc,OAAA;AAAA;AAAA,EAEvB,MAAA;AAAA,EAAQ,WAAA;AAAA,EAAa,YAAA;AAAA,EAAc,WAAA;AAAA,EAAa,YAAA;AAAA;AAAA;AAAA;AAAA,EAIhD,OAAA;AAAA,EAAS,MAAA;AAAA,EAAQ,cAAA;AAAA,EAAgB,aAAA;AAAA,EAAe,WAAA;AAAA,EAAa,cAAA;AAAA,EAAgB,aAAA;AAAA;AAAA,EAE7E,OAAA;AAAA,EAAS,WAAA;AAAA,EACT,aAAA;AAAA,EAAe,oBAAA;AAAA,EAAsB,cAAA;AAAA;AAAA,EAErC,gBAAA;AAAA,EAAkB,mBAAA;AAAA,EAAqB,SAAA;AAAA,EACvC,SAAA;AAAA,EAAW,aAAA;AAAA,EAAe,UAAA;AAAA,EAAY,aAAA;AAAA;AAAA,EAEtC,OAAA;AAAA,EAAS,SAAA;AAAA,EAAW,OAAA;AAAA,EAAS,SAAA;AAAA;AAAA,EAE7B,KAAA;AAAA,EAAO,YAAA;AAAA,EAAc,WAAA;AAAA;AAAA,EAErB,QAAA;AAAA,EAAU,aAAA;AAAA;AAAA,EAEV,gBAAA;AAAA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AA,EAAY,MAAA,EAAQ,KAAK,CAAC,CAAA;AACrD;;;;"}
@@ -106,6 +106,7 @@ const ELEMENT_SLOT_KEYS = /* @__PURE__ */ new Set([
106
106
  "paginatorPageReport",
107
107
  "paginatorRowsPerPage",
108
108
  "paginatorRowsPerPageDropdown",
109
+ "paginatorPages",
109
110
  "sortedColumn",
110
111
  "stripedRow",
111
112
  "selectedRow",
@@ -117,6 +118,15 @@ const ELEMENT_SLOT_KEYS = /* @__PURE__ */ new Set([
117
118
  "toolbarButton",
118
119
  "clearFilterButton",
119
120
  "columnPicker",
121
+ // Toolbar sizing + placeholder, and the chrome the table renders itself.
122
+ // NOTE: a slot missing from this allowlist is silently dropped — theming
123
+ // it has no effect at all — so every new slot must be listed here as
124
+ // well as in its component's ITableElementSlots.
125
+ "toolbarControl",
126
+ "filterPlaceholder",
127
+ "topBar",
128
+ "bulkBar",
129
+ "bulkBarText",
120
130
  // Accordion
121
131
  "headerActive",
122
132
  "headerHover",
@@ -1 +1 @@
1
- {"version":3,"file":"useComponentDefaults.js","sources":["../../../src/hooks/useComponentDefaults.ts"],"sourcesContent":["import {useMemo} from 'react';\nimport {useKitsTheme} from '../contexts/Theme';\n\n/**\n * Known element slot keys. When a config key matches one of these\n * AND the value has `props` or `style`, it is treated as an element slot.\n *\n * To add a new slot: add the key here AND to the relevant slot interface\n * in packages/types/src/Theme/types.ts (and to the `AllSlotKeys` union).\n *\n * The order below mirrors the typed slot hierarchy in\n * `packages/types/src/Theme/types.ts`.\n */\nconst ELEMENT_SLOT_KEYS = new Set([\n // ── Form-element slots ──────────────────────────────────\n // Base (all form elements — IFormElementBaseSlots)\n 'label', 'helperText', 'error',\n // Text input specific (ITextInputSlots — also shared by ISelectSlots)\n 'root', 'container', 'inputGroup', 'leftAddon', 'rightAddon',\n // Select specific (ISelectSlots — option-list popover)\n // Radio / Checkbox also use `item` / `itemSelected` / `itemDisabled` /\n // `itemHover` for the per-list-item wrapper, plus `itemInvalid`.\n 'panel', 'item', 'itemSelected', 'itemFocused', 'itemHover', 'itemDisabled', 'itemInvalid',\n // MultiSelect specific (IMultiSelectSlots — chips + per-item checkbox)\n 'token', 'tokenIcon',\n 'checkboxBox', 'checkboxBoxChecked', 'checkboxIcon',\n // Datepicker specific (IDatepickerSlots — calendar popup; `panel` shared with Select)\n 'calendarHeader', 'calendarNavButton', 'weekDay',\n 'dayCell', 'daySelected', 'dayToday', 'dayDisabled',\n // Switch specific (ISwitchSlots) — RENAMED from slider/sliderChecked/thumbChecked\n 'track', 'trackOn', 'thumb', 'thumbOn',\n // Checkbox specific (ICheckboxSlots)\n 'box', 'boxChecked', 'checkIcon',\n // Radio specific (IRadioSlots)\n 'circle', 'circleInner',\n // Radio + Checkbox: wrapper Flex around all list items\n 'itemsContainer',\n\n // ── Non-form component slots (untouched by the form-element refactor) ──\n // Card / Button / generic\n 'icon', 'header', 'title', 'subTitle', 'content', 'footer',\n // Button variants — `text` applies only to buttons with a label,\n // `iconOnly` applies only to icon-only buttons (so styling one never\n // affects the other).\n 'text', 'iconOnly',\n // Table\n 'th', 'headerRow', 'headerCell', 'body', 'bodyRow', 'bodyCell',\n 'wrapper', 'table', 'tbody',\n 'filterRow', 'filterCell', 'filterClearButton',\n 'columnFilter', 'columnFilterInput',\n 'tfoot', 'footerRow', 'footerCell', 'footer', 'paginator', 'emptyMessage',\n 'loadingOverlay', 'loadingIcon',\n 'rowGroupHeader', 'rowGroupHeaderName', 'rowExpansion', 'rowGroupFooter',\n 'rowGroupToggler', 'rowGroupTogglerIcon',\n 'resizeHelper',\n 'reorderIndicatorUp', 'reorderIndicatorUpIcon',\n 'reorderIndicatorDown', 'reorderIndicatorDownIcon',\n 'tableHeader', 'searchInput',\n 'paginatorPageButton', 'paginatorPageLink', 'paginatorActivePageButton',\n 'paginatorPageReport', 'paginatorRowsPerPage', 'paginatorRowsPerPageDropdown',\n 'sortedColumn', 'stripedRow', 'selectedRow', 'selectedRowAccent',\n 'filterBar', 'filterInput', 'filterLabel',\n 'toolbarRight', 'toolbarButton', 'clearFilterButton', 'columnPicker',\n // Accordion\n 'headerActive', 'headerHover',\n // Sidebar/Drawer\n 'headerTitle', 'closeButton', 'mask',\n // Group (repeatable field array)\n 'row', 'addButton', 'removeButton',\n // Header (app-shell top bar)\n 'toggleModeButton', 'avatarButton', 'breadcrumb',\n]);\n\nexport interface IElementConfig {\n style: Record<string, any>;\n important?: boolean | string[];\n pseudo?: Record<string, Record<string, any>>;\n}\n\nexport interface UseComponentDefaultsResult<T> {\n /** Props with theme defaults merged in (user props always win) */\n mergedProps: T;\n /**\n * CSS style from root slot — backwards compat for components\n * that read themeStyle instead of elementStyles.root\n */\n themeStyle: Record<string, any>;\n /**\n * Per-element style maps. Each key is a slot name, value is the\n * merged IStyleClasses (not yet resolved to CSSProperties).\n * Use `useResolvedElementStyles(elementStyles)` to resolve.\n */\n elementStyles: Record<string, Record<string, any>>;\n /**\n * Full slot configs including `important` and `pseudo` fields.\n * Use this instead of `elementStyles` when you need those fields.\n */\n elementConfigs: Record<string, IElementConfig>;\n}\n\n/**\n * Merges theme-level component defaults with user-supplied props.\n *\n * Resolution chain (lowest → highest priority):\n * FormElement[slot] < baseGroup[slot] < component[slot] < instanceSlots[slot] < user props\n *\n * `FormElement` is the global base group for every form element\n * (label / helperText / error live there by default). It is applied\n * to every component regardless of whether a `baseGroup` is provided\n * — for non-form components like Button or Card, FormElement slots\n * are no-ops in practice because those components don't read\n * `elementStyles.label` / `helperText` / `error`.\n *\n * Element slots (`root`, `label`, `container`, etc.) are direct keys\n * on the component config. Each slot accepts `{ props?, style? }`.\n *\n * The `root` slot's `props` are merged into `mergedProps` alongside\n * user props (user always wins). The `root` slot's `style` is returned\n * as both `themeStyle` (backwards compat) and `elementStyles.root`.\n *\n * Supports base-group inheritance: e.g. `useComponentDefaults('InputText', rawProps, 'Input')`\n * merges FormElement first, then Input base, then InputText overrides,\n * then per-instance slots, then user props.\n *\n * @example\n * const { mergedProps, themeStyle, elementStyles } = useComponentDefaults('InputText', rawProps, 'Input');\n * // mergedProps → FormElement.root.props < Input.root.props < InputText.root.props < instanceSlots < user props\n * // elementStyles.label → FormElement.label.style < Input.label.style < InputText.label.style < instance label\n * // elementStyles.root → root element style (FormElement → Input → InputText → instance)\n * // elementStyles.container → container element style\n */\nexport default function useComponentDefaults<T extends Record<string, any>>(\n componentName: string,\n props: T,\n baseGroup?: string,\n): UseComponentDefaultsResult<T> {\n const {theme} = useKitsTheme();\n // Global base for every form element. Always looked up — if not\n // configured it is `undefined` and the merge contributes nothing.\n const formElementConfig = theme.components.FormElement;\n const baseConfig = baseGroup ? theme.components[baseGroup] : undefined;\n const config = theme.components[componentName];\n\n return useMemo(() => {\n // Extract per-instance slot overrides from props (IFormElement.slots passed through)\n const instanceSlots = (props as any).slots as Record<string, { props?: any; style?: any; important?: boolean | string[]; pseudo?: Record<string, Record<string, any>> }> | undefined;\n\n if (!config && !baseConfig && !instanceSlots && !formElementConfig) {\n return {mergedProps: props, themeStyle: {}, elementStyles: {}, elementConfigs: {}};\n }\n\n const formBase = (formElementConfig || {}) as Record<string, any>;\n const base = (baseConfig || {}) as Record<string, any>;\n const comp = (config || {}) as Record<string, any>;\n\n // --- Props merge: FormElement.root.props < base.root.props < config.root.props < instanceSlots.root.props < user props ---\n const merged = {\n ...(formBase.root?.props || {}),\n ...(base.root?.props || {}),\n ...(comp.root?.props || {}),\n ...(instanceSlots?.root?.props || {}),\n } as Record<string, any>;\n\n for (const key of Object.keys(props)) {\n // Skip 'slots' — it is consumed here, not forwarded\n if (key === 'slots') continue;\n if (props[key] !== undefined) {\n merged[key] = props[key];\n }\n }\n\n // --- Element styles merge: FormElement[slot] < base[slot] < config[slot] < instanceSlots[slot] ---\n const allSlotKeys = new Set<string>();\n for (const key of Object.keys(formBase)) {\n if (ELEMENT_SLOT_KEYS.has(key)) allSlotKeys.add(key);\n }\n for (const key of Object.keys(base)) {\n if (ELEMENT_SLOT_KEYS.has(key)) allSlotKeys.add(key);\n }\n for (const key of Object.keys(comp)) {\n if (ELEMENT_SLOT_KEYS.has(key)) allSlotKeys.add(key);\n }\n if (instanceSlots) {\n for (const key of Object.keys(instanceSlots)) {\n if (ELEMENT_SLOT_KEYS.has(key)) allSlotKeys.add(key);\n }\n }\n\n const elementStyles: Record<string, Record<string, any>> = {};\n const elementConfigs: Record<string, IElementConfig> = {};\n for (const slotKey of allSlotKeys) {\n const style = {\n ...(formBase[slotKey]?.style || {}),\n ...(base[slotKey]?.style || {}),\n ...(comp[slotKey]?.style || {}),\n ...(instanceSlots?.[slotKey]?.style || {}),\n };\n elementStyles[slotKey] = style;\n\n const pseudoMerged = {\n ...(formBase[slotKey]?.pseudo || {}),\n ...(base[slotKey]?.pseudo || {}),\n ...(comp[slotKey]?.pseudo || {}),\n ...(instanceSlots?.[slotKey]?.pseudo || {}),\n };\n elementConfigs[slotKey] = {\n style,\n important:\n instanceSlots?.[slotKey]?.important ??\n comp[slotKey]?.important ??\n base[slotKey]?.important ??\n formBase[slotKey]?.important,\n pseudo: Object.keys(pseudoMerged).length > 0 ? pseudoMerged : undefined,\n };\n }\n\n // themeStyle = root element style (backwards compat)\n const themeStyle = elementStyles.root || {};\n\n return {\n mergedProps: merged as T,\n themeStyle,\n elementStyles,\n elementConfigs,\n };\n }, [formElementConfig, baseConfig, config, props]);\n}\n"],"names":[],"mappings":";;;AAaA,MAAM,iBAAA,uBAAwB,GAAA,CAAI;AAAA;AAAA;AAAA,EAG9B,OAAA;AAAA,EAAS,YAAA;AAAA,EAAc,OAAA;AAAA;AAAA,EAEvB,MAAA;AAAA,EAAQ,WAAA;AAAA,EAAa,YAAA;AAAA,EAAc,WAAA;AAAA,EAAa,YAAA;AAAA;AAAA;AAAA;AAAA,EAIhD,OAAA;AAAA,EAAS,MAAA;AAAA,EAAQ,cAAA;AAAA,EAAgB,aAAA;AAAA,EAAe,WAAA;AAAA,EAAa,cAAA;AAAA,EAAgB,aAAA;AAAA;AAAA,EAE7E,OAAA;AAAA,EAAS,WAAA;AAAA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MAAA,GAAS,IAAI,YAAA,GAAe;AAAA,OAClE;AAAA,IACJ;AAGA,IAAA,MAAM,UAAA,GAAa,aAAA,CAAc,IAAA,IAAQ,EAAC;AAE1C,IAAA,OAAO;AAAA,MACH,WAAA,EAAa,MAAA;AAAA,MACb,UAAA;AAAA,MACA,aAAA;AAAA,MACA;AAAA,KACJ;AAAA,EACJ,GAAG,CAAC,iBAAA,EAAmB,UAAA,EAAY,MAAA,EAAQ,KAAK,CAAC,CAAA;AACrD;;;;"}
1
+ {"version":3,"file":"useComponentDefaults.js","sources":["../../../src/hooks/useComponentDefaults.ts"],"sourcesContent":["import {useMemo} from 'react';\nimport {useKitsTheme} from '../contexts/Theme';\n\n/**\n * Known element slot keys. When a config key matches one of these\n * AND the value has `props` or `style`, it is treated as an element slot.\n *\n * To add a new slot: add the key here AND to the relevant slot interface\n * in packages/types/src/Theme/types.ts (and to the `AllSlotKeys` union).\n *\n * The order below mirrors the typed slot hierarchy in\n * `packages/types/src/Theme/types.ts`.\n */\nconst ELEMENT_SLOT_KEYS = new Set([\n // ── Form-element slots ──────────────────────────────────\n // Base (all form elements — IFormElementBaseSlots)\n 'label', 'helperText', 'error',\n // Text input specific (ITextInputSlots — also shared by ISelectSlots)\n 'root', 'container', 'inputGroup', 'leftAddon', 'rightAddon',\n // Select specific (ISelectSlots — option-list popover)\n // Radio / Checkbox also use `item` / `itemSelected` / `itemDisabled` /\n // `itemHover` for the per-list-item wrapper, plus `itemInvalid`.\n 'panel', 'item', 'itemSelected', 'itemFocused', 'itemHover', 'itemDisabled', 'itemInvalid',\n // MultiSelect specific (IMultiSelectSlots — chips + per-item checkbox)\n 'token', 'tokenIcon',\n 'checkboxBox', 'checkboxBoxChecked', 'checkboxIcon',\n // Datepicker specific (IDatepickerSlots — calendar popup; `panel` shared with Select)\n 'calendarHeader', 'calendarNavButton', 'weekDay',\n 'dayCell', 'daySelected', 'dayToday', 'dayDisabled',\n // Switch specific (ISwitchSlots) — RENAMED from slider/sliderChecked/thumbChecked\n 'track', 'trackOn', 'thumb', 'thumbOn',\n // Checkbox specific (ICheckboxSlots)\n 'box', 'boxChecked', 'checkIcon',\n // Radio specific (IRadioSlots)\n 'circle', 'circleInner',\n // Radio + Checkbox: wrapper Flex around all list items\n 'itemsContainer',\n\n // ── Non-form component slots (untouched by the form-element refactor) ──\n // Card / Button / generic\n 'icon', 'header', 'title', 'subTitle', 'content', 'footer',\n // Button variants — `text` applies only to buttons with a label,\n // `iconOnly` applies only to icon-only buttons (so styling one never\n // affects the other).\n 'text', 'iconOnly',\n // Table\n 'th', 'headerRow', 'headerCell', 'body', 'bodyRow', 'bodyCell',\n 'wrapper', 'table', 'tbody',\n 'filterRow', 'filterCell', 'filterClearButton',\n 'columnFilter', 'columnFilterInput',\n 'tfoot', 'footerRow', 'footerCell', 'footer', 'paginator', 'emptyMessage',\n 'loadingOverlay', 'loadingIcon',\n 'rowGroupHeader', 'rowGroupHeaderName', 'rowExpansion', 'rowGroupFooter',\n 'rowGroupToggler', 'rowGroupTogglerIcon',\n 'resizeHelper',\n 'reorderIndicatorUp', 'reorderIndicatorUpIcon',\n 'reorderIndicatorDown', 'reorderIndicatorDownIcon',\n 'tableHeader', 'searchInput',\n 'paginatorPageButton', 'paginatorPageLink', 'paginatorActivePageButton',\n 'paginatorPageReport', 'paginatorRowsPerPage', 'paginatorRowsPerPageDropdown',\n 'paginatorPages',\n 'sortedColumn', 'stripedRow', 'selectedRow', 'selectedRowAccent',\n 'filterBar', 'filterInput', 'filterLabel',\n 'toolbarRight', 'toolbarButton', 'clearFilterButton', 'columnPicker',\n // Toolbar sizing + placeholder, and the chrome the table renders itself.\n // NOTE: a slot missing from this allowlist is silently dropped — theming\n // it has no effect at all — so every new slot must be listed here as\n // well as in its component's ITableElementSlots.\n 'toolbarControl', 'filterPlaceholder',\n 'topBar', 'bulkBar', 'bulkBarText',\n // Accordion\n 'headerActive', 'headerHover',\n // Sidebar/Drawer\n 'headerTitle', 'closeButton', 'mask',\n // Group (repeatable field array)\n 'row', 'addButton', 'removeButton',\n // Header (app-shell top bar)\n 'toggleModeButton', 'avatarButton', 'breadcrumb',\n]);\n\nexport interface IElementConfig {\n style: Record<string, any>;\n important?: boolean | string[];\n pseudo?: Record<string, Record<string, any>>;\n}\n\nexport interface UseComponentDefaultsResult<T> {\n /** Props with theme defaults merged in (user props always win) */\n mergedProps: T;\n /**\n * CSS style from root slot — backwards compat for components\n * that read themeStyle instead of elementStyles.root\n */\n themeStyle: Record<string, any>;\n /**\n * Per-element style maps. Each key is a slot name, value is the\n * merged IStyleClasses (not yet resolved to CSSProperties).\n * Use `useResolvedElementStyles(elementStyles)` to resolve.\n */\n elementStyles: Record<string, Record<string, any>>;\n /**\n * Full slot configs including `important` and `pseudo` fields.\n * Use this instead of `elementStyles` when you need those fields.\n */\n elementConfigs: Record<string, IElementConfig>;\n}\n\n/**\n * Merges theme-level component defaults with user-supplied props.\n *\n * Resolution chain (lowest → highest priority):\n * FormElement[slot] < baseGroup[slot] < component[slot] < instanceSlots[slot] < user props\n *\n * `FormElement` is the global base group for every form element\n * (label / helperText / error live there by default). It is applied\n * to every component regardless of whether a `baseGroup` is provided\n * — for non-form components like Button or Card, FormElement slots\n * are no-ops in practice because those components don't read\n * `elementStyles.label` / `helperText` / `error`.\n *\n * Element slots (`root`, `label`, `container`, etc.) are direct keys\n * on the component config. Each slot accepts `{ props?, style? }`.\n *\n * The `root` slot's `props` are merged into `mergedProps` alongside\n * user props (user always wins). The `root` slot's `style` is returned\n * as both `themeStyle` (backwards compat) and `elementStyles.root`.\n *\n * Supports base-group inheritance: e.g. `useComponentDefaults('InputText', rawProps, 'Input')`\n * merges FormElement first, then Input base, then InputText overrides,\n * then per-instance slots, then user props.\n *\n * @example\n * const { mergedProps, themeStyle, elementStyles } = useComponentDefaults('InputText', rawProps, 'Input');\n * // mergedProps → FormElement.root.props < Input.root.props < InputText.root.props < instanceSlots < user props\n * // elementStyles.label → FormElement.label.style < Input.label.style < InputText.label.style < instance label\n * // elementStyles.root → root element style (FormElement → Input → InputText → instance)\n * // elementStyles.container → container element style\n */\nexport default function useComponentDefaults<T extends Record<string, any>>(\n componentName: string,\n props: T,\n baseGroup?: string,\n): UseComponentDefaultsResult<T> {\n const {theme} = useKitsTheme();\n // Global base for every form element. Always looked up — if not\n // configured it is `undefined` and the merge contributes nothing.\n const formElementConfig = theme.components.FormElement;\n const baseConfig = baseGroup ? theme.components[baseGroup] : undefined;\n const config = theme.components[componentName];\n\n return useMemo(() => {\n // Extract per-instance slot overrides from props (IFormElement.slots passed through)\n const instanceSlots = (props as any).slots as Record<string, { props?: any; style?: any; important?: boolean | string[]; pseudo?: Record<string, Record<string, any>> }> | undefined;\n\n if (!config && !baseConfig && !instanceSlots && !formElementConfig) {\n return {mergedProps: props, themeStyle: {}, elementStyles: {}, elementConfigs: {}};\n }\n\n const formBase = (formElementConfig || {}) as Record<string, any>;\n const base = (baseConfig || {}) as Record<string, any>;\n const comp = (config || {}) as Record<string, any>;\n\n // --- Props merge: FormElement.root.props < base.root.props < config.root.props < instanceSlots.root.props < user props ---\n const merged = {\n ...(formBase.root?.props || {}),\n ...(base.root?.props || {}),\n ...(comp.root?.props || {}),\n ...(instanceSlots?.root?.props || {}),\n } as Record<string, any>;\n\n for (const key of Object.keys(props)) {\n // Skip 'slots' — it is consumed here, not forwarded\n if (key === 'slots') continue;\n if (props[key] !== undefined) {\n merged[key] = props[key];\n }\n }\n\n // --- Element styles merge: FormElement[slot] < base[slot] < config[slot] < instanceSlots[slot] ---\n const allSlotKeys = new Set<string>();\n for (const key of Object.keys(formBase)) {\n if (ELEMENT_SLOT_KEYS.has(key)) allSlotKeys.add(key);\n }\n for (const key of Object.keys(base)) {\n if (ELEMENT_SLOT_KEYS.has(key)) allSlotKeys.add(key);\n }\n for (const key of Object.keys(comp)) {\n if (ELEMENT_SLOT_KEYS.has(key)) allSlotKeys.add(key);\n }\n if (instanceSlots) {\n for (const key of Object.keys(instanceSlots)) {\n if (ELEMENT_SLOT_KEYS.has(key)) allSlotKeys.add(key);\n }\n }\n\n const elementStyles: Record<string, Record<string, any>> = {};\n const elementConfigs: Record<string, IElementConfig> = {};\n for (const slotKey of allSlotKeys) {\n const style = {\n ...(formBase[slotKey]?.style || {}),\n ...(base[slotKey]?.style || {}),\n ...(comp[slotKey]?.style || {}),\n ...(instanceSlots?.[slotKey]?.style || {}),\n };\n elementStyles[slotKey] = style;\n\n const pseudoMerged = {\n ...(formBase[slotKey]?.pseudo || {}),\n ...(base[slotKey]?.pseudo || {}),\n ...(comp[slotKey]?.pseudo || {}),\n ...(instanceSlots?.[slotKey]?.pseudo || {}),\n };\n elementConfigs[slotKey] = {\n style,\n important:\n instanceSlots?.[slotKey]?.important ??\n comp[slotKey]?.important ??\n base[slotKey]?.important ??\n formBase[slotKey]?.important,\n pseudo: Object.keys(pseudoMerged).length > 0 ? pseudoMerged : undefined,\n };\n }\n\n // themeStyle = root element style (backwards compat)\n const themeStyle = elementStyles.root || {};\n\n return {\n mergedProps: merged as T,\n themeStyle,\n elementStyles,\n elementConfigs,\n };\n }, [formElementConfig, baseConfig, config, props]);\n}\n"],"names":[],"mappings":";;;AAaA,MAAM,iBAAA,uBAAwB,GAAA,CAAI;AAAA;AAAA;AAAA,EAG9B,OAAA;AAAA,EAAS,YAAA;AAAA,EAAc,OAAA;AAAA;AAAA,EAEvB,MAAA;AAAA,EAAQ,WAAA;AAAA,EAAa,YAAA;AAAA,EAAc,WAAA;AAAA,EAAa,YAAA;AAAA;AAAA;AAAA;AAAA,EAIhD,OAAA;AAAA,EAAS,MAAA;AAAA,EAAQ,cAAA;AAAA,EAAgB,aAAA;AAAA,EAAe,WAAA;AAAA,EAAa,cAAA;AAAA,EAAgB,aAAA;AAAA;AAAA,EAE7E,OAAA;AAAA,EAAS,WAAA;AAAA,EACT,aAAA;AAAA,EAAe,oBAAA;AAAA,EAAsB,cAAA;AAAA;AAAA,EAErC,gBAAA;AAAA,EAAkB,mBAAA;AAAA,EAAqB,SAAA;AAA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