@cck-ui/core 0.20.1 → 0.20.3
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/cjs/components/action-icon/action-icon-group/action-icon-group.cjs +2 -2
- package/cjs/components/action-icon/action-icon-group/action-icon-group.cjs.map +1 -1
- package/cjs/components/action-icon/action-icon-group-section/action-icon-group-section.cjs +2 -2
- package/cjs/components/action-icon/action-icon-group-section/action-icon-group-section.cjs.map +1 -1
- package/cjs/components/action-icon/action-icon.cjs +2 -2
- package/cjs/components/action-icon/action-icon.cjs.map +1 -1
- package/cjs/components/alert/alert.cjs +2 -2
- package/cjs/components/alert/alert.cjs.map +1 -1
- package/cjs/components/aspect-ratio/aspect-ratio.cjs +2 -2
- package/cjs/components/aspect-ratio/aspect-ratio.cjs.map +1 -1
- package/cjs/components/button/button-group/button-group.cjs +2 -2
- package/cjs/components/button/button-group/button-group.cjs.map +1 -1
- package/cjs/components/button/button-group-section/button-group-section.cjs +2 -2
- package/cjs/components/button/button-group-section/button-group-section.cjs.map +1 -1
- package/cjs/components/button/button.cjs +2 -2
- package/cjs/components/button/button.cjs.map +1 -1
- package/cjs/components/center/center.cjs +2 -2
- package/cjs/components/center/center.cjs.map +1 -1
- package/cjs/components/close-button/close-button.cjs +2 -2
- package/cjs/components/close-button/close-button.cjs.map +1 -1
- package/cjs/components/container/container.cjs +2 -2
- package/cjs/components/container/container.cjs.map +1 -1
- package/cjs/components/empty-state/empty-state.cjs +2 -2
- package/cjs/components/empty-state/empty-state.cjs.map +1 -1
- package/cjs/components/file-button/file-button.cjs +116 -0
- package/cjs/components/file-button/file-button.cjs.map +1 -0
- package/cjs/components/file-button/index.cjs +10 -0
- package/cjs/components/file-button/index.cjs.map +1 -0
- package/cjs/components/flex/flex.cjs +2 -2
- package/cjs/components/flex/flex.cjs.map +1 -1
- package/cjs/components/grid/grid.cjs +2 -2
- package/cjs/components/grid/grid.cjs.map +1 -1
- package/cjs/components/group/group.cjs +2 -2
- package/cjs/components/group/group.cjs.map +1 -1
- package/cjs/components/image/image.cjs +2 -2
- package/cjs/components/image/image.cjs.map +1 -1
- package/cjs/components/loader/loader.cjs +2 -2
- package/cjs/components/loader/loader.cjs.map +1 -1
- package/cjs/components/paper/paper.cjs +2 -2
- package/cjs/components/paper/paper.cjs.map +1 -1
- package/cjs/components/semi-circle-progress/semi-circle-progress.cjs +2 -2
- package/cjs/components/semi-circle-progress/semi-circle-progress.cjs.map +1 -1
- package/cjs/components/simple-grid/simple-grid.cjs +2 -2
- package/cjs/components/simple-grid/simple-grid.cjs.map +1 -1
- package/cjs/components/skeleton/skeleton.cjs +2 -2
- package/cjs/components/skeleton/skeleton.cjs.map +1 -1
- package/cjs/components/space/space.cjs +2 -2
- package/cjs/components/space/space.cjs.map +1 -1
- package/cjs/components/splitter/splitter.cjs +2 -2
- package/cjs/components/splitter/splitter.cjs.map +1 -1
- package/cjs/components/stack/stack.cjs +2 -2
- package/cjs/components/stack/stack.cjs.map +1 -1
- package/cjs/components/text/text.cjs +2 -2
- package/cjs/components/text/text.cjs.map +1 -1
- package/cjs/components/unstyled-button/unstyled-button.cjs +2 -2
- package/cjs/components/unstyled-button/unstyled-button.cjs.map +1 -1
- package/cjs/core/styles-api/use-styles/use-styles.cjs +4 -2
- package/cjs/core/styles-api/use-styles/use-styles.cjs.map +1 -1
- package/cjs/index.cjs +43 -40
- package/cjs/index.cjs.map +1 -1
- package/esm/components/action-icon/action-icon-group/action-icon-group.mjs +2 -2
- package/esm/components/action-icon/action-icon-group/action-icon-group.mjs.map +1 -1
- package/esm/components/action-icon/action-icon-group-section/action-icon-group-section.mjs +2 -2
- package/esm/components/action-icon/action-icon-group-section/action-icon-group-section.mjs.map +1 -1
- package/esm/components/action-icon/action-icon.mjs +2 -2
- package/esm/components/action-icon/action-icon.mjs.map +1 -1
- package/esm/components/alert/alert.mjs +2 -2
- package/esm/components/alert/alert.mjs.map +1 -1
- package/esm/components/aspect-ratio/aspect-ratio.mjs +2 -2
- package/esm/components/aspect-ratio/aspect-ratio.mjs.map +1 -1
- package/esm/components/button/button-group/button-group.mjs +2 -2
- package/esm/components/button/button-group/button-group.mjs.map +1 -1
- package/esm/components/button/button-group-section/button-group-section.mjs +2 -2
- package/esm/components/button/button-group-section/button-group-section.mjs.map +1 -1
- package/esm/components/button/button.mjs +2 -2
- package/esm/components/button/button.mjs.map +1 -1
- package/esm/components/center/center.mjs +2 -2
- package/esm/components/center/center.mjs.map +1 -1
- package/esm/components/close-button/close-button.mjs +2 -2
- package/esm/components/close-button/close-button.mjs.map +1 -1
- package/esm/components/container/container.mjs +2 -2
- package/esm/components/container/container.mjs.map +1 -1
- package/esm/components/empty-state/empty-state.mjs +2 -2
- package/esm/components/empty-state/empty-state.mjs.map +1 -1
- package/esm/components/file-button/file-button.mjs +116 -0
- package/esm/components/file-button/file-button.mjs.map +1 -0
- package/esm/components/file-button/index.mjs +9 -0
- package/esm/components/file-button/index.mjs.map +1 -0
- package/esm/components/flex/flex.mjs +2 -2
- package/esm/components/flex/flex.mjs.map +1 -1
- package/esm/components/grid/grid.mjs +2 -2
- package/esm/components/grid/grid.mjs.map +1 -1
- package/esm/components/group/group.mjs +2 -2
- package/esm/components/group/group.mjs.map +1 -1
- package/esm/components/image/image.mjs +2 -2
- package/esm/components/image/image.mjs.map +1 -1
- package/esm/components/loader/loader.mjs +2 -2
- package/esm/components/loader/loader.mjs.map +1 -1
- package/esm/components/paper/paper.mjs +2 -2
- package/esm/components/paper/paper.mjs.map +1 -1
- package/esm/components/semi-circle-progress/semi-circle-progress.mjs +2 -2
- package/esm/components/semi-circle-progress/semi-circle-progress.mjs.map +1 -1
- package/esm/components/simple-grid/simple-grid.mjs +2 -2
- package/esm/components/simple-grid/simple-grid.mjs.map +1 -1
- package/esm/components/skeleton/skeleton.mjs +2 -2
- package/esm/components/skeleton/skeleton.mjs.map +1 -1
- package/esm/components/space/space.mjs +2 -2
- package/esm/components/space/space.mjs.map +1 -1
- package/esm/components/splitter/splitter.mjs +2 -2
- package/esm/components/splitter/splitter.mjs.map +1 -1
- package/esm/components/stack/stack.mjs +2 -2
- package/esm/components/stack/stack.mjs.map +1 -1
- package/esm/components/text/text.mjs +2 -2
- package/esm/components/text/text.mjs.map +1 -1
- package/esm/components/unstyled-button/unstyled-button.mjs +2 -2
- package/esm/components/unstyled-button/unstyled-button.mjs.map +1 -1
- package/esm/core/styles-api/use-styles/use-styles.mjs +4 -2
- package/esm/core/styles-api/use-styles/use-styles.mjs.map +1 -1
- package/esm/index.mjs +3 -1
- package/esm/index.mjs.map +1 -1
- package/lib/components/file-button/file-button.types.d.ts +31 -0
- package/lib/components/file-button/index.d.ts +3 -0
- package/lib/components/index.d.ts +1 -0
- package/lib/core/styles-api/use-styles/use-styles.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"splitter.cjs","names":[],"sources":["../../../src/components/splitter/splitter.vue"],"sourcesContent":["<template>\n <c-box ref=\"rootRef\" v-bind=\"mergedAttrs\">\n <template v-for=\"(vnode, index) in paneVNodes\" :key=\"`pane-${index}`\">\n <c-box\n v-if=\"index > 0\"\n v-bind=\"handleAttrs(index - 1)\"\n :key=\"`handle-${index - 1}`\"\n @pointerdown=\"splitter.getHandleEventHandlers({ index: index - 1 }).onPointerDown\"\n @touchstart=\"splitter.getHandleEventHandlers({ index: index - 1 }).onTouchStart\"\n @keydown=\"splitter.getHandleEventHandlers({ index: index - 1 }).onKeyDown\"\n @dblclick=\"handleDblClick(index - 1)\"\n >\n <c-box\n v-if=\"withHandle\"\n v-bind=\"getStyles('thumb')\"\n :data-orientation=\"orientation\"\n :data-active=\"isHandleActive(index - 1) || undefined\"\n >\n <component :is=\"thumbIcon\" :orientation=\"defaultIcon\" />\n </c-box>\n </c-box>\n\n <component :is=\"vnode\" :__index=\"index\" />\n </template>\n </c-box>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs, useSlots, watch, watchEffect } from 'vue'\nimport { CBox, CStyleProp, useComponentProps, useStyles } from '../../core'\nimport { SplitterFactory, type SplitterProps } from './splitter.types'\nimport classes from './splitter.module.css'\nimport { varsResolver } from './splitter.utils'\nimport SplitterPane from './splitter-pane/splitter-pane.vue'\nimport { useSplitter, UseSplitterPanel } from '@cck-ui/hooks'\nimport { provideSplitterContext } from './splitter.context'\nimport GripIcon from './grip-icon.vue'\n\ndefineOptions({\n name: 'CSplitter',\n})\n\nconst rootRef = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\nconst slots = useSlots()\n\nconst rawProps = defineProps<SplitterProps>()\n\nconst defaultProps = {\n orientation: 'horizontal',\n lineSize: 2,\n withHandle: true,\n resetOnDoubleClick: true,\n} satisfies Partial<SplitterProps>\n\nconst props = useComponentProps({\n component: 'CSplitter',\n defaultProps,\n props: rawProps,\n})\n\nconst knownProps = [\n 'classNames',\n 'className',\n 'style',\n 'styles',\n 'unstyled',\n 'vars',\n 'orientation',\n 'sizes',\n 'onSizeChange',\n 'onResizeStart',\n 'onResizeEnd',\n 'onCollapseChange',\n 'redistribute',\n 'step',\n 'shiftStep',\n 'lineSize',\n 'handleColor',\n 'handleIcon',\n 'withHandle',\n 'resetOnDoubleClick',\n 'mod',\n 'attributes',\n]\n\nconst modList = computed(() => [\n {\n orientation: props.value.orientation,\n },\n])\n\nconst styleProps = computed(() => ({\n ...props.value,\n ...attrs,\n style: (attrs.style ?? props.value.style) as CStyleProp,\n}))\n\nconst getStyles = useStyles<SplitterFactory>({\n name: 'Splitter',\n classes,\n props: styleProps,\n className: props.value.className,\n style: props.value.style,\n classNames: props.value.classNames,\n styles: props.value.styles,\n unstyled: props.value.unstyled,\n attributes: props.value.attributes,\n vars: props.value.vars,\n varsResolver,\n})\n\nconst paneVNodes = ref<any[]>([])\nconst panels = ref<UseSplitterPanel[]>([])\n\nwatchEffect(() => {\n const defaultSlots = slots.default?.() || []\n const filtered = defaultSlots.filter((vnode) => vnode.type === SplitterPane)\n paneVNodes.value = filtered\n panels.value = filtered.map((vnode) => {\n const vProps = vnode.props || {}\n return {\n defaultSize: vProps.defaultSize ?? vProps['default-size'] ?? 0,\n min: vProps.min ?? undefined,\n max: vProps.max ?? undefined,\n collapsible: vProps.collapsible ?? false,\n collapseThreshold: vProps.collapseThreshold ?? vProps['collapse-threshold'] ?? undefined,\n }\n })\n})\n\nconst splitter = useSplitter({\n panels: panels.value,\n orientation: props.value.orientation,\n sizes: props.value.sizes,\n onSizeChange: props.value.onSizeChange,\n onResizeStart: props.value.onResizeStart,\n onResizeEnd: props.value.onResizeEnd,\n onCollapseChange: props.value.onCollapseChange,\n redistribute: props.value.redistribute,\n step: props.value.step,\n shiftStep: props.value.shiftStep,\n resetOnDoubleClick: props.value.resetOnDoubleClick,\n})\n\nwatch(\n rootRef,\n (newVal) => {\n if (newVal) {\n const domEl = newVal.$el || newVal.root\n if (domEl instanceof HTMLElement) {\n splitter.containerRef(domEl)\n }\n } else {\n splitter.containerRef(null)\n }\n },\n { immediate: true }\n)\n\nconst getHandleAttrs = (index: number) => {\n const handleProps = splitter.getHandleProps({ index })\n const { ref: _ref, onDoubleClick, ...attrs } = handleProps\n return {\n role: attrs.role,\n 'aria-orientation': attrs['aria-orientation'],\n 'aria-valuenow': handleProps['aria-valuenow'],\n 'aria-valuemin': handleProps['aria-valuemin'],\n 'aria-valuemax': handleProps['aria-valuemax'],\n tabIndex: handleProps.tabIndex,\n 'data-active': handleProps['data-active'],\n 'data-orientation': handleProps['data-orientation'],\n }\n}\n\nconst isHandleActive = (index: number) => {\n return splitter.activeHandle === index\n}\n\nconst handleAttrs = (index: number) => {\n const styles = getStyles('handle')\n const attrs = getHandleAttrs(index)\n return {\n ...styles,\n ...attrs,\n key: `handle-${index}`,\n }\n}\n\nconst getPaneStyle = (index: number) => {\n const sizes = splitter.sizes.value\n const size = sizes[index]\n const pixelMode = splitter.pixelMode\n if (!pixelMode) {\n const magnitude = typeof size === 'number' ? size : parseFloat(size as string)\n return { flexBasis: `${magnitude}%` }\n }\n const isFixed = typeof size === 'string' && (size.endsWith('px') || size.endsWith('rem'))\n if (isFixed) {\n return { flexGrow: 0, flexShrink: 1, flexBasis: size as string }\n }\n const magnitude = typeof size === 'number' ? size : parseFloat(size as string)\n return { flexGrow: magnitude, flexShrink: 1, flexBasis: 0 }\n}\n\nwatch(\n () => props.value.sizes,\n (newSizes) => {\n if (!newSizes) {\n return\n }\n const currentSizes = splitter.sizes.value\n if (JSON.stringify(newSizes) !== JSON.stringify(currentSizes)) {\n splitter.setSizes(newSizes)\n }\n },\n { immediate: true, deep: true }\n)\n\nconst collapsed = computed(() => splitter.collapsed)\nconst orientation = computed(() => props.value.orientation || 'horizontal')\n\nprovideSplitterContext({\n getStyles,\n sizes: splitter.sizes,\n collapsed,\n orientation,\n getPaneStyle,\n})\n\nconst defaultIcon = computed(() =>\n props.value.orientation === 'vertical' ? 'horizontal' : 'vertical'\n)\n\nconst thumbIcon = computed(() => {\n if (props.value.handleIcon !== undefined) {\n return props.value.handleIcon\n }\n return GripIcon\n})\n\nconst withHandle = computed(() => props.value.withHandle)\n\nconst handleDblClick = (index: number) => {\n if (props.value.resetOnDoubleClick !== false) {\n splitter.reset(index)\n }\n}\n\nconst rootAttrs = computed(() => getStyles('root'))\n\nconst mergedAttrs = computed(() => {\n const others: Record<string, any> = {}\n const propsValue = props.value\n for (const key in propsValue) {\n if (!knownProps.includes(key)) {\n others[key] = propsValue[key as keyof typeof propsValue]\n }\n }\n const userMod = props.value.mod\n const mergedMod = [\n ...(Array.isArray(userMod) ? userMod : [userMod].filter(Boolean)),\n ...(modList.value || []),\n ]\n return { ...others, mod: mergedMod, ...rootAttrs.value }\n})\n\ndefineExpose({\n root: computed(() => rootRef.value?.root || null),\n sizes: splitter.sizes,\n collapsed: splitter.collapsed,\n activeHandle: splitter.activeHandle,\n setSizes: splitter.setSizes,\n collapse: splitter.collapse,\n expand: splitter.expand,\n toggleCollapse: splitter.toggleCollapse,\n reset: splitter.reset,\n})\n</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s","names":[],"sources":["../../../src/components/splitter/splitter.vue"],"sourcesContent":["<template>\n <c-box ref=\"rootRef\" v-bind=\"mergedAttrs\">\n <template v-for=\"(vnode, index) in paneVNodes\" :key=\"`pane-${index}`\">\n <c-box\n v-if=\"index > 0\"\n v-bind=\"handleAttrs(index - 1)\"\n :key=\"`handle-${index - 1}`\"\n @pointerdown=\"splitter.getHandleEventHandlers({ index: index - 1 }).onPointerDown\"\n @touchstart=\"splitter.getHandleEventHandlers({ index: index - 1 }).onTouchStart\"\n @keydown=\"splitter.getHandleEventHandlers({ index: index - 1 }).onKeyDown\"\n @dblclick=\"handleDblClick(index - 1)\"\n >\n <c-box\n v-if=\"withHandle\"\n v-bind=\"getStyles('thumb')\"\n :data-orientation=\"orientation\"\n :data-active=\"isHandleActive(index - 1) || undefined\"\n >\n <component :is=\"thumbIcon\" :orientation=\"defaultIcon\" />\n </c-box>\n </c-box>\n\n <component :is=\"vnode\" :__index=\"index\" />\n </template>\n </c-box>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs, useSlots, watch, watchEffect } from 'vue'\nimport { CBox, CStyleProp, useComponentProps, useStyles } from '../../core'\nimport { SplitterFactory, type SplitterProps } from './splitter.types'\nimport classes from './splitter.module.css'\nimport { varsResolver } from './splitter.utils'\nimport SplitterPane from './splitter-pane/splitter-pane.vue'\nimport { useSplitter, UseSplitterPanel } from '@cck-ui/hooks'\nimport { provideSplitterContext } from './splitter.context'\nimport GripIcon from './grip-icon.vue'\n\ndefineOptions({\n name: 'CSplitter',\n})\n\nconst rootRef = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\nconst slots = useSlots()\n\nconst rawProps = defineProps<SplitterProps>()\n\nconst defaultProps = {\n orientation: 'horizontal',\n lineSize: 2,\n withHandle: true,\n resetOnDoubleClick: true,\n} satisfies Partial<SplitterProps>\n\nconst props = useComponentProps({\n component: 'CSplitter',\n defaultProps,\n props: rawProps,\n})\n\nconst knownProps = [\n 'classNames',\n 'className',\n 'style',\n 'styles',\n 'unstyled',\n 'vars',\n 'orientation',\n 'sizes',\n 'onSizeChange',\n 'onResizeStart',\n 'onResizeEnd',\n 'onCollapseChange',\n 'redistribute',\n 'step',\n 'shiftStep',\n 'lineSize',\n 'handleColor',\n 'handleIcon',\n 'withHandle',\n 'resetOnDoubleClick',\n 'mod',\n 'attributes',\n]\n\nconst modList = computed(() => [\n {\n orientation: props.value.orientation,\n },\n])\n\nconst styleProps = computed(() => ({\n ...props.value,\n ...attrs,\n style: (attrs.style ?? props.value.style) as CStyleProp,\n}))\n\nconst getStyles = useStyles<SplitterFactory>({\n name: 'Splitter',\n classes,\n props: styleProps,\n className: () => props.value.className,\n style: () => props.value.style,\n classNames: props.value.classNames,\n styles: props.value.styles,\n unstyled: props.value.unstyled,\n attributes: props.value.attributes,\n vars: props.value.vars,\n varsResolver,\n})\n\nconst paneVNodes = ref<any[]>([])\nconst panels = ref<UseSplitterPanel[]>([])\n\nwatchEffect(() => {\n const defaultSlots = slots.default?.() || []\n const filtered = defaultSlots.filter((vnode) => vnode.type === SplitterPane)\n paneVNodes.value = filtered\n panels.value = filtered.map((vnode) => {\n const vProps = vnode.props || {}\n return {\n defaultSize: vProps.defaultSize ?? vProps['default-size'] ?? 0,\n min: vProps.min ?? undefined,\n max: vProps.max ?? undefined,\n collapsible: vProps.collapsible ?? false,\n collapseThreshold: vProps.collapseThreshold ?? vProps['collapse-threshold'] ?? undefined,\n }\n })\n})\n\nconst splitter = useSplitter({\n panels: panels.value,\n orientation: props.value.orientation,\n sizes: props.value.sizes,\n onSizeChange: props.value.onSizeChange,\n onResizeStart: props.value.onResizeStart,\n onResizeEnd: props.value.onResizeEnd,\n onCollapseChange: props.value.onCollapseChange,\n redistribute: props.value.redistribute,\n step: props.value.step,\n shiftStep: props.value.shiftStep,\n resetOnDoubleClick: props.value.resetOnDoubleClick,\n})\n\nwatch(\n rootRef,\n (newVal) => {\n if (newVal) {\n const domEl = newVal.$el || newVal.root\n if (domEl instanceof HTMLElement) {\n splitter.containerRef(domEl)\n }\n } else {\n splitter.containerRef(null)\n }\n },\n { immediate: true }\n)\n\nconst getHandleAttrs = (index: number) => {\n const handleProps = splitter.getHandleProps({ index })\n const { ref: _ref, onDoubleClick, ...attrs } = handleProps\n return {\n role: attrs.role,\n 'aria-orientation': attrs['aria-orientation'],\n 'aria-valuenow': handleProps['aria-valuenow'],\n 'aria-valuemin': handleProps['aria-valuemin'],\n 'aria-valuemax': handleProps['aria-valuemax'],\n tabIndex: handleProps.tabIndex,\n 'data-active': handleProps['data-active'],\n 'data-orientation': handleProps['data-orientation'],\n }\n}\n\nconst isHandleActive = (index: number) => {\n return splitter.activeHandle === index\n}\n\nconst handleAttrs = (index: number) => {\n const styles = getStyles('handle')\n const attrs = getHandleAttrs(index)\n return {\n ...styles,\n ...attrs,\n key: `handle-${index}`,\n }\n}\n\nconst getPaneStyle = (index: number) => {\n const sizes = splitter.sizes.value\n const size = sizes[index]\n const pixelMode = splitter.pixelMode\n if (!pixelMode) {\n const magnitude = typeof size === 'number' ? size : parseFloat(size as string)\n return { flexBasis: `${magnitude}%` }\n }\n const isFixed = typeof size === 'string' && (size.endsWith('px') || size.endsWith('rem'))\n if (isFixed) {\n return { flexGrow: 0, flexShrink: 1, flexBasis: size as string }\n }\n const magnitude = typeof size === 'number' ? size : parseFloat(size as string)\n return { flexGrow: magnitude, flexShrink: 1, flexBasis: 0 }\n}\n\nwatch(\n () => props.value.sizes,\n (newSizes) => {\n if (!newSizes) {\n return\n }\n const currentSizes = splitter.sizes.value\n if (JSON.stringify(newSizes) !== JSON.stringify(currentSizes)) {\n splitter.setSizes(newSizes)\n }\n },\n { immediate: true, deep: true }\n)\n\nconst collapsed = computed(() => splitter.collapsed)\nconst orientation = computed(() => props.value.orientation || 'horizontal')\n\nprovideSplitterContext({\n getStyles,\n sizes: splitter.sizes,\n collapsed,\n orientation,\n getPaneStyle,\n})\n\nconst defaultIcon = computed(() =>\n props.value.orientation === 'vertical' ? 'horizontal' : 'vertical'\n)\n\nconst thumbIcon = computed(() => {\n if (props.value.handleIcon !== undefined) {\n return props.value.handleIcon\n }\n return GripIcon\n})\n\nconst withHandle = computed(() => props.value.withHandle)\n\nconst handleDblClick = (index: number) => {\n if (props.value.resetOnDoubleClick !== false) {\n splitter.reset(index)\n }\n}\n\nconst rootAttrs = computed(() => getStyles('root'))\n\nconst mergedAttrs = computed(() => {\n const others: Record<string, any> = {}\n const propsValue = props.value\n for (const key in propsValue) {\n if (!knownProps.includes(key)) {\n others[key] = propsValue[key as keyof typeof propsValue]\n }\n }\n const userMod = props.value.mod\n const mergedMod = [\n ...(Array.isArray(userMod) ? userMod : [userMod].filter(Boolean)),\n ...(modList.value || []),\n ]\n return { ...others, mod: mergedMod, ...rootAttrs.value }\n})\n\ndefineExpose({\n root: computed(() => rootRef.value?.root || null),\n sizes: splitter.sizes,\n collapsed: splitter.collapsed,\n activeHandle: splitter.activeHandle,\n setSizes: splitter.setSizes,\n collapse: splitter.collapse,\n expand: splitter.expand,\n toggleCollapse: splitter.toggleCollapse,\n reset: splitter.reset,\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0CA,MAAM,WAAA,GAAA,IAAA,IAAA,CAAgD,IAAI;EAE1D,MAAM,SAAA,GAAA,IAAA,SAAA,CAAiB;E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QAAK,EAAA,CAAA,CAAA,CAAQ;IAClE,WAAS,OAAA,SAAS,uBAAsB,EAAA,OAAU,QAAK,EAAA,CAAA,CAAA,CAAQ;IAC/D,aAAQ,WAAE,OAAA,eAAe,QAAK,CAAA;;oCASvB,CANA,OAAA,eAAA,GAAA,IAAA,UAAA,CAAA,IAAA,GAAA,IAAA,YAAA,CAMA,OAAA,UAAA,GAAA,IAAA,WAAA,CAAA;;;OALE,OAAA,UAAS,OAAA,GAAA;KAChB,oBAAkB,OAAA;KAClB,eAAa,OAAA,eAAe,QAAK,CAAA,KAAS,KAAA;;qCAEa,GAAA,GAAA,IAAA,UAAA,CAAA,IAAA,GAAA,IAAA,YAAA,EAAA,GAAA,IAAA,wBAAA,CAAxC,OAAA,SAAS,GAAA,EAAG,aAAa,OAAA,YAAW,GAAA,MAAA,GAAA,CAAA,aAAA,CAAA,EAAA,CAAA;;;;;;;;;iIAIxC,KAAK,GAAA,EAAG,SAAS,MAAK,GAAA,MAAA,GAAA,CAAA,SAAA,CAAA,EAAA,GAAA,EAAA"}
|
|
@@ -349,8 +349,8 @@ const _sfc_main = /*@__PURE__*/ (0, vue.defineComponent)({
|
|
|
349
349
|
name: "Stack",
|
|
350
350
|
props: styleProps,
|
|
351
351
|
classes: require_stack_module.default,
|
|
352
|
-
className: props.value.className,
|
|
353
|
-
style: props.value.style,
|
|
352
|
+
className: () => props.value.className,
|
|
353
|
+
style: () => props.value.style,
|
|
354
354
|
classNames: props.value.classNames,
|
|
355
355
|
styles: props.value.styles,
|
|
356
356
|
unstyled: props.value.unstyled,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stack.cjs","names":[],"sources":["../../../src/components/stack/stack.vue"],"sourcesContent":["<template>\n <c-box ref=\"_root\" v-bind=\"mergedAttrs\" :variant=\"props.variant\">\n <slot />\n </c-box>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs } from 'vue'\nimport { StackFactory, StackProps } from './stack.types'\nimport { CBox, CStyleProp, useComponentProps, useStyles } from '../../core'\nimport classes from './stack.module.css'\nimport { varsResolver } from './stack.utils'\n\ndefineOptions({\n name: 'CStack',\n})\n\nconst _root = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<StackProps>()\n\nconst defaultProps = {\n gap: 'md',\n align: 'stretch',\n justify: 'flex-start',\n} satisfies Partial<StackProps>\n\nconst props = useComponentProps({\n component: 'CStack',\n defaultProps,\n props: rawProps,\n})\n\nconst knownProps = [\n 'classNames',\n 'className',\n 'style',\n 'styles',\n 'unstyled',\n 'vars',\n 'align',\n 'justify',\n 'gap',\n 'variant',\n 'attributes',\n]\n\nconst styleProps = computed(() => ({\n ...props.value,\n ...attrs,\n style: (attrs.style ?? props.value.style) as CStyleProp,\n}))\n\nconst getStyles = useStyles<StackFactory>({\n name: 'Stack',\n props: styleProps,\n classes,\n className: props.value.className,\n style: props.value.style,\n classNames: props.value.classNames,\n styles: props.value.styles,\n unstyled: props.value.unstyled,\n attributes: props.value.attributes,\n vars: props.value.vars,\n varsResolver,\n})\n\nconst rootAttrs = computed(() => getStyles('root'))\n\nconst mergedAttrs = computed(() => {\n const others: Record<string, any> = {}\n const propsValue = props.value\n Object.keys(propsValue).forEach((key) => {\n if (!knownProps.includes(key)) {\n others[key] = propsValue[key as keyof typeof propsValue]\n }\n })\n const userMod = props.value.mod\n const mergedMod = [...(Array.isArray(userMod) ? userMod : [userMod].filter(Boolean))]\n return { ...others, mod: mergedMod, ...rootAttrs.value }\n})\n\ndefineExpose({\n root: computed(() => _root.value?.root ?? null),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBA,MAAM,SAAA,GAAA,IAAA,IAAA,CAA8C,IAAI;EAExD,MAAM,SAAA,GAAA,IAAA,SAAA,CAAiB;EAEvB,MAAM,WAAW;EAEjB,MAAM,eAAe;GACnB,KAAK;GACL,OAAO;GACP,SAAS;EACX;EAEA,MAAM,QAAQ,4BAAA,kBAAkB;GAC9B,WAAW;GACX;GACA,OAAO;EACT,CAAC;EAED,MAAM,aAAa;GACjB;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;EAEA,MAAM,cAAA,GAAA,IAAA,SAAA,QAA6B;GACjC,GAAG,MAAM;GACT,GAAG;GACH,OAAQ,MAAM,SAAS,MAAM,MAAM;EACrC,EAAE;EAEF,MAAM,YAAY,mBAAA,UAAwB;GACxC,MAAM;GACN,OAAO;GACP,SAAA,qBAAA;GACA,
|
|
1
|
+
{"version":3,"file":"stack.cjs","names":[],"sources":["../../../src/components/stack/stack.vue"],"sourcesContent":["<template>\n <c-box ref=\"_root\" v-bind=\"mergedAttrs\" :variant=\"props.variant\">\n <slot />\n </c-box>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs } from 'vue'\nimport { StackFactory, StackProps } from './stack.types'\nimport { CBox, CStyleProp, useComponentProps, useStyles } from '../../core'\nimport classes from './stack.module.css'\nimport { varsResolver } from './stack.utils'\n\ndefineOptions({\n name: 'CStack',\n})\n\nconst _root = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<StackProps>()\n\nconst defaultProps = {\n gap: 'md',\n align: 'stretch',\n justify: 'flex-start',\n} satisfies Partial<StackProps>\n\nconst props = useComponentProps({\n component: 'CStack',\n defaultProps,\n props: rawProps,\n})\n\nconst knownProps = [\n 'classNames',\n 'className',\n 'style',\n 'styles',\n 'unstyled',\n 'vars',\n 'align',\n 'justify',\n 'gap',\n 'variant',\n 'attributes',\n]\n\nconst styleProps = computed(() => ({\n ...props.value,\n ...attrs,\n style: (attrs.style ?? props.value.style) as CStyleProp,\n}))\n\nconst getStyles = useStyles<StackFactory>({\n name: 'Stack',\n props: styleProps,\n classes,\n className: () => props.value.className,\n style: () => props.value.style,\n classNames: props.value.classNames,\n styles: props.value.styles,\n unstyled: props.value.unstyled,\n attributes: props.value.attributes,\n vars: props.value.vars,\n varsResolver,\n})\n\nconst rootAttrs = computed(() => getStyles('root'))\n\nconst mergedAttrs = computed(() => {\n const others: Record<string, any> = {}\n const propsValue = props.value\n Object.keys(propsValue).forEach((key) => {\n if (!knownProps.includes(key)) {\n others[key] = propsValue[key as keyof typeof propsValue]\n }\n })\n const userMod = props.value.mod\n const mergedMod = [...(Array.isArray(userMod) ? userMod : [userMod].filter(Boolean))]\n return { ...others, mod: mergedMod, ...rootAttrs.value }\n})\n\ndefineExpose({\n root: computed(() => _root.value?.root ?? null),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBA,MAAM,SAAA,GAAA,IAAA,IAAA,CAA8C,IAAI;EAExD,MAAM,SAAA,GAAA,IAAA,SAAA,CAAiB;EAEvB,MAAM,WAAW;EAEjB,MAAM,eAAe;GACnB,KAAK;GACL,OAAO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,aAAW,EAAG,SAAS,OAAA,MAAM,QAAA,CAAA,GAAA;kCAC9C,EAAA,GAAA,IAAA,WAAA,CAAA,KAAA,QAAA,SAAA,CAAA,CAAA"}
|
|
@@ -385,8 +385,8 @@ const _sfc_main = /*@__PURE__*/ (0, vue.defineComponent)({
|
|
|
385
385
|
name: ["Text", props.value.__staticSelector],
|
|
386
386
|
props: styleProps,
|
|
387
387
|
classes: require_text_module.default,
|
|
388
|
-
className: props.value.className,
|
|
389
|
-
style: props.value.style,
|
|
388
|
+
className: () => props.value.className,
|
|
389
|
+
style: () => props.value.style,
|
|
390
390
|
classNames: props.value.classNames,
|
|
391
391
|
styles: props.value.styles,
|
|
392
392
|
unstyled: props.value.unstyled,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.cjs","names":[],"sources":["../../../src/components/text/text.vue"],"sourcesContent":["<template>\n <c-box\n ref=\"_root\"\n v-bind=\"mergedAttrs\"\n :size=\"props.size\"\n :tag=\"props.span ? 'span' : 'p'\"\n :variant=\"props.variant\"\n >\n <slot />\n </c-box>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs } from 'vue'\nimport type { TextFactory, TextProps, TextTruncate } from './text.types.ts'\nimport classes from './text.module.css'\nimport { useStyles, CBox, useComponentProps, CStyleProp } from '../../core'\nimport { varsResolver } from './text.utils.js'\n\ndefineOptions({\n name: 'CText',\n})\n\nconst _root = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<TextProps>()\n\nconst props = useComponentProps({\n component: 'CText',\n defaultProps: {},\n props: rawProps,\n})\n\nfunction getTextTruncate(truncate: TextTruncate | undefined) {\n if (truncate === 'start') {\n return 'start'\n }\n\n if (truncate === 'end' || truncate) {\n return 'end'\n }\n\n return undefined\n}\n\nconst knownProps = [\n 'lineClamp',\n 'truncate',\n 'inline',\n 'inherit',\n 'gradient',\n 'span',\n 'textWrap',\n '__staticSelector',\n 'vars',\n 'className',\n 'style',\n 'classNames',\n 'styles',\n 'unstyled',\n 'variant',\n 'mod',\n 'size',\n 'attributes',\n]\n\nconst modList = computed(() => [\n {\n 'data-truncate': getTextTruncate(props.value.truncate),\n 'data-line-clamp': typeof props.value.lineClamp === 'number',\n 'data-inline': props.value.inline,\n 'data-inherit': props.value.inherit,\n },\n])\n\nconst styleProps = computed(() => ({\n ...props.value,\n ...attrs,\n style: (attrs.style ?? props.value.style) as CStyleProp,\n}))\n\nconst getStyles = useStyles<TextFactory>({\n name: ['Text', props.value.__staticSelector],\n props: styleProps,\n classes,\n className: props.value.className,\n style: props.value.style,\n classNames: props.value.classNames,\n styles: props.value.styles,\n unstyled: props.value.unstyled,\n attributes: props.value.attributes,\n vars: props.value.vars,\n varsResolver,\n})\n\nconst rootAttrs = computed(() => getStyles('root', { focusable: true }))\n\nconst mergedAttrs = computed(() => {\n const others: Record<string, any> = {}\n const propsValue = props.value\n for (const key in propsValue) {\n if (!knownProps.includes(key)) {\n others[key] = propsValue[key as keyof typeof propsValue]\n }\n }\n const userMod = props.value.mod\n const mergedMod = [\n ...(Array.isArray(userMod) ? userMod : [userMod].filter(Boolean)),\n ...(modList.value || []),\n ]\n return { ...others, mod: mergedMod, ...rootAttrs.value }\n})\n\ndefineExpose({\n root: computed(() => _root.value?.root ?? null),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuBA,MAAM,SAAA,GAAA,IAAA,IAAA,CAA8C,IAAI;EAExD,MAAM,SAAA,GAAA,IAAA,SAAA,CAAiB;EAEvB,MAAM,WAAW;EAEjB,MAAM,QAAQ,4BAAA,kBAAkB;GAC9B,WAAW;GACX,cAAc,CAAC;GACf,OAAO;EACT,CAAC;EAED,SAAS,gBAAgB,UAAoC;GAC3D,IAAI,aAAa,SACf,OAAO;GAGT,IAAI,aAAa,SAAS,UACxB,OAAO;EAIX;EAEA,MAAM,aAAa;GACjB;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;EAEA,MAAM,WAAA,GAAA,IAAA,SAAA,OAAyB,CAC7B;GACE,iBAAiB,gBAAgB,MAAM,MAAM,QAAQ;GACrD,mBAAmB,OAAO,MAAM,MAAM,cAAc;GACpD,eAAe,MAAM,MAAM;GAC3B,gBAAgB,MAAM,MAAM;EAC9B,CACF,CAAC;EAED,MAAM,cAAA,GAAA,IAAA,SAAA,QAA6B;GACjC,GAAG,MAAM;GACT,GAAG;GACH,OAAQ,MAAM,SAAS,MAAM,MAAM;EACrC,EAAE;EAEF,MAAM,YAAY,mBAAA,UAAuB;GACvC,MAAM,CAAC,QAAQ,MAAM,MAAM,gBAAgB;GAC3C,OAAO;GACP,SAAA,oBAAA;GACA,
|
|
1
|
+
{"version":3,"file":"text.cjs","names":[],"sources":["../../../src/components/text/text.vue"],"sourcesContent":["<template>\n <c-box\n ref=\"_root\"\n v-bind=\"mergedAttrs\"\n :size=\"props.size\"\n :tag=\"props.span ? 'span' : 'p'\"\n :variant=\"props.variant\"\n >\n <slot />\n </c-box>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs } from 'vue'\nimport type { TextFactory, TextProps, TextTruncate } from './text.types.ts'\nimport classes from './text.module.css'\nimport { useStyles, CBox, useComponentProps, CStyleProp } from '../../core'\nimport { varsResolver } from './text.utils.js'\n\ndefineOptions({\n name: 'CText',\n})\n\nconst _root = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<TextProps>()\n\nconst props = useComponentProps({\n component: 'CText',\n defaultProps: {},\n props: rawProps,\n})\n\nfunction getTextTruncate(truncate: TextTruncate | undefined) {\n if (truncate === 'start') {\n return 'start'\n }\n\n if (truncate === 'end' || truncate) {\n return 'end'\n }\n\n return undefined\n}\n\nconst knownProps = [\n 'lineClamp',\n 'truncate',\n 'inline',\n 'inherit',\n 'gradient',\n 'span',\n 'textWrap',\n '__staticSelector',\n 'vars',\n 'className',\n 'style',\n 'classNames',\n 'styles',\n 'unstyled',\n 'variant',\n 'mod',\n 'size',\n 'attributes',\n]\n\nconst modList = computed(() => [\n {\n 'data-truncate': getTextTruncate(props.value.truncate),\n 'data-line-clamp': typeof props.value.lineClamp === 'number',\n 'data-inline': props.value.inline,\n 'data-inherit': props.value.inherit,\n },\n])\n\nconst styleProps = computed(() => ({\n ...props.value,\n ...attrs,\n style: (attrs.style ?? props.value.style) as CStyleProp,\n}))\n\nconst getStyles = useStyles<TextFactory>({\n name: ['Text', props.value.__staticSelector],\n props: styleProps,\n classes,\n className: () => props.value.className,\n style: () => props.value.style,\n classNames: props.value.classNames,\n styles: props.value.styles,\n unstyled: props.value.unstyled,\n attributes: props.value.attributes,\n vars: props.value.vars,\n varsResolver,\n})\n\nconst rootAttrs = computed(() => getStyles('root', { focusable: true }))\n\nconst mergedAttrs = computed(() => {\n const others: Record<string, any> = {}\n const propsValue = props.value\n for (const key in propsValue) {\n if (!knownProps.includes(key)) {\n others[key] = propsValue[key as keyof typeof propsValue]\n }\n }\n const userMod = props.value.mod\n const mergedMod = [\n ...(Array.isArray(userMod) ? userMod : [userMod].filter(Boolean)),\n ...(modList.value || []),\n ]\n return { ...others, mod: mergedMod, ...rootAttrs.value }\n})\n\ndefineExpose({\n root: computed(() => _root.value?.root ?? null),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;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GACA,iBAAiB,MAAM,MAAM;GAC7B,aAAa,MAAM,MAAM;GACzB,YAAY,MAAM,MAAM;GACxB,QAAQ,MAAM,MAAM;GACpB,UAAU,MAAM,MAAM;GACtB,YAAY,MAAM,MAAM;GACxB,MAAM,MAAM,MAAM;GAClB,cAAA,mBAAA;EACF,CAAC;EAED,MAAM,aAAA,GAAA,IAAA,SAAA,OAA2B,UAAU,QAAQ,EAAE,WAAW,KAAK,CAAC,CAAC;EAEvE,MAAM,eAAA,GAAA,IAAA,SAAA,OAA6B;GACjC,MAAM,SAA8B,CAAC;GACrC,MAAM,aAAa,MAAM;GACzB,KAAK,MAAM,OAAO,YAChB,IAAI,CAAC,WAAW,SAAS,GAAG,GAC1B,OAAO,OAAO,WAAW;GAG7B,MAAM,UAAU,MAAM,MAAM;GAC5B,MAAM,YAAY,CAChB,GAAI,MAAM,QAAQ,OAAO,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC,OAAO,OAAO,GAC/D,GAAI,QAAQ,SAAS,CAAC,CACxB;GACA,OAAO;IAAE,GAAG;IAAQ,KAAK;IAAW,GAAG,UAAU;GAAM;EACzD,CAAC;EAED,SAAa,EACX,OAAA,GAAA,IAAA,SAAA,OAAqB,MAAM,OAAO,QAAQ,IAAI,EAChD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;mDA5GS,OAAA,UAAA,GAAA,IAAA,WAAA,CAAA,EAPN,KAAI,QAAO,GACH,OAAA,aAAW;EAClB,MAAM,OAAA,MAAM;EACZ,KAAK,OAAA,MAAM,OAAI,SAAA;EACf,SAAS,OAAA,MAAM;;kCAER,EAAA,GAAA,IAAA,WAAA,CAAA,KAAA,QAAA,SAAA,CAAA,CAAA"}
|
|
@@ -341,8 +341,8 @@ const _sfc_main = /*@__PURE__*/ (0, vue.defineComponent)({
|
|
|
341
341
|
name: props.value.__staticSelector,
|
|
342
342
|
props: styleProps,
|
|
343
343
|
classes: require_unstyled_button_module.default,
|
|
344
|
-
className: props.value.className,
|
|
345
|
-
style: props.value.style,
|
|
344
|
+
className: () => props.value.className,
|
|
345
|
+
style: () => props.value.style,
|
|
346
346
|
classNames: props.value.classNames,
|
|
347
347
|
styles: props.value.styles,
|
|
348
348
|
unstyled: props.value.unstyled,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unstyled-button.cjs","names":[],"sources":["../../../src/components/unstyled-button/unstyled-button.vue"],"sourcesContent":["<template>\n <c-box\n ref=\"_root\"\n v-bind=\"mergedAttrs\"\n :tag=\"tag\"\n :type=\"tag === 'button' ? 'button' : undefined\"\n >\n <slot />\n </c-box>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs } from 'vue'\nimport { CBox, CStyleProp, useComponentProps, useStyles } from '../../core'\nimport type { UnstyledButtonFactory, UnstyledButtonProps } from './unstyled-button.types'\nimport classes from './unstyled-button.module.css'\n\ndefineOptions({\n name: 'UnstyledButton',\n})\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<UnstyledButtonProps>()\n\nconst props = useComponentProps({\n component: 'UnstyledButton',\n defaultProps: {\n __staticSelector: 'UnstyledButton',\n },\n props: rawProps,\n})\n\nconst { tag = 'button' } = props.value\n\nconst _root = ref<InstanceType<typeof CBox> | null>(null)\n\nconst knownProps = [\n 'className',\n 'tag',\n '__staticSelector',\n 'unstyled',\n 'classNames',\n 'styles',\n 'style',\n 'attributes',\n]\n\nconst styleProps = computed(() => ({\n ...props.value,\n ...attrs,\n style: (attrs.style ?? props.value.style) as CStyleProp,\n}))\n\nconst getStyles = useStyles<UnstyledButtonFactory>({\n name: props.value.__staticSelector!,\n props: styleProps,\n classes,\n className: props.value.className,\n style: props.value.style,\n classNames: props.value.classNames,\n styles: props.value.styles,\n unstyled: props.value.unstyled,\n attributes: props.value.attributes,\n})\n\nconst rootAttrs = computed(() => getStyles('root', { focusable: true }))\nconst mergedAttrs = computed(() => {\n const others: Record<string, any> = {}\n const propsValue = props.value\n for (const key in propsValue) {\n if (!knownProps.includes(key)) {\n others[key] = propsValue[key as keyof typeof propsValue]\n }\n }\n return { ...others, ...rootAttrs.value }\n})\n\ndefineExpose({\n root: computed(() => _root.value?.root ?? null),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqBA,MAAM,SAAA,GAAA,IAAA,SAAA,CAAiB;EAEvB,MAAM,WAAW;EAEjB,MAAM,QAAQ,4BAAA,kBAAkB;GAC9B,WAAW;GACX,cAAc,EACZ,kBAAkB,iBACpB;GACA,OAAO;EACT,CAAC;EAED,MAAM,EAAE,MAAM,aAAa,MAAM;EAEjC,MAAM,SAAA,GAAA,IAAA,IAAA,CAA8C,IAAI;EAExD,MAAM,aAAa;GACjB;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;EAEA,MAAM,cAAA,GAAA,IAAA,SAAA,QAA6B;GACjC,GAAG,MAAM;GACT,GAAG;GACH,OAAQ,MAAM,SAAS,MAAM,MAAM;EACrC,EAAE;EAEF,MAAM,YAAY,mBAAA,UAAiC;GACjD,MAAM,MAAM,MAAM;GAClB,OAAO;GACP,SAAA,+BAAA;GACA,
|
|
1
|
+
{"version":3,"file":"unstyled-button.cjs","names":[],"sources":["../../../src/components/unstyled-button/unstyled-button.vue"],"sourcesContent":["<template>\n <c-box\n ref=\"_root\"\n v-bind=\"mergedAttrs\"\n :tag=\"tag\"\n :type=\"tag === 'button' ? 'button' : undefined\"\n >\n <slot />\n </c-box>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs } from 'vue'\nimport { CBox, CStyleProp, useComponentProps, useStyles } from '../../core'\nimport type { UnstyledButtonFactory, UnstyledButtonProps } from './unstyled-button.types'\nimport classes from './unstyled-button.module.css'\n\ndefineOptions({\n name: 'UnstyledButton',\n})\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<UnstyledButtonProps>()\n\nconst props = useComponentProps({\n component: 'UnstyledButton',\n defaultProps: {\n __staticSelector: 'UnstyledButton',\n },\n props: rawProps,\n})\n\nconst { tag = 'button' } = props.value\n\nconst _root = ref<InstanceType<typeof CBox> | null>(null)\n\nconst knownProps = [\n 'className',\n 'tag',\n '__staticSelector',\n 'unstyled',\n 'classNames',\n 'styles',\n 'style',\n 'attributes',\n]\n\nconst styleProps = computed(() => ({\n ...props.value,\n ...attrs,\n style: (attrs.style ?? props.value.style) as CStyleProp,\n}))\n\nconst getStyles = useStyles<UnstyledButtonFactory>({\n name: props.value.__staticSelector!,\n props: styleProps,\n classes,\n className: () => props.value.className,\n style: () => props.value.style,\n classNames: props.value.classNames,\n styles: props.value.styles,\n unstyled: props.value.unstyled,\n attributes: props.value.attributes,\n})\n\nconst rootAttrs = computed(() => getStyles('root', { focusable: true }))\nconst mergedAttrs = computed(() => {\n const others: Record<string, any> = {}\n const propsValue = props.value\n for (const key in propsValue) {\n if (!knownProps.includes(key)) {\n others[key] = propsValue[key as keyof typeof propsValue]\n }\n }\n return { ...others, ...rootAttrs.value }\n})\n\ndefineExpose({\n root: computed(() => _root.value?.root ?? null),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;mDAxES,OAAA,UAAA,GAAA,IAAA,WAAA,CAAA,EANN,KAAI,QAAO,GACH,OAAA,aAAW;EAClB,KAAK,OAAA;EACL,MAAM,OAAA,QAAG,WAAA,WAA2B,KAAA;;kCAE7B,EAAA,GAAA,IAAA,WAAA,CAAA,KAAA,QAAA,SAAA,CAAA,CAAA"}
|
|
@@ -24,6 +24,8 @@ function useStyles({ name, classes, props, stylesCtx, className, style, rootSele
|
|
|
24
24
|
return (selector, options) => {
|
|
25
25
|
const currentProps = (0, vue.toValue)(props);
|
|
26
26
|
const currentCtx = (0, vue.toValue)(stylesCtx);
|
|
27
|
+
const currentStyle = (0, vue.toValue)(style);
|
|
28
|
+
const currentClassName = (0, vue.toValue)(className);
|
|
27
29
|
const resolvedClassNames = require_resolve_class_names.resolveClassNames({
|
|
28
30
|
theme,
|
|
29
31
|
classNames,
|
|
@@ -61,7 +63,7 @@ function useStyles({ name, classes, props, stylesCtx, className, style, rootSele
|
|
|
61
63
|
vars?.(theme, currentProps, currentCtx)
|
|
62
64
|
]);
|
|
63
65
|
const resolvedRootStyle = require_resolve_style.resolveStyle({
|
|
64
|
-
style,
|
|
66
|
+
style: currentStyle,
|
|
65
67
|
theme
|
|
66
68
|
});
|
|
67
69
|
return {
|
|
@@ -76,7 +78,7 @@ function useStyles({ name, classes, props, stylesCtx, className, style, rootSele
|
|
|
76
78
|
resolvedThemeClassNames,
|
|
77
79
|
classes,
|
|
78
80
|
unstyled,
|
|
79
|
-
className,
|
|
81
|
+
className: currentClassName,
|
|
80
82
|
rootSelector,
|
|
81
83
|
props: currentProps,
|
|
82
84
|
stylesCtx: currentCtx,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-styles.cjs","names":["useCckTheme","useCckClassNamesPrefix","useCckWithStaticClasses","useCckIsHeadless","useStylesTransform","resolveClassNames","resolveStyles","mergeVars","resolveStyle","getClassName","getStyle"],"sources":["../../../../src/core/styles-api/use-styles/use-styles.ts"],"sourcesContent":["import {\n Attributes,\n ClassNames,\n ClassNamesArray,\n GetStylesApiOptions,\n Styles,\n} from '../styles-api.types'\nimport { PartialVarsResolver, VarsResolver } from '../create-vars-resolver/create-vars-resolver'\nimport { useStylesTransform } from './use-transformed-styles'\nimport { resolveClassNames } from './get-class-name/resolve-class-names/resolve-class-names'\nimport { resolveStyles } from './get-style/resolve-styles/resolve-styles'\nimport { mergeVars } from './get-style/resolve-vars/merge-vars'\nimport { resolveStyle } from './get-style/resolve-style/resolve-style'\nimport { getClassName } from './get-class-name/get-class-name'\nimport { Properties } from 'csstype'\nimport { getStyle } from './get-style/get-style'\nimport { FactoryPayload } from '../../factory'\nimport { CStyleProp } from '../../box'\nimport {\n useCckClassNamesPrefix,\n useCckIsHeadless,\n useCckTheme,\n useCckWithStaticClasses,\n} from '../../config-provider'\nimport { MaybeRefOrGetter, toValue } from 'vue'\n\nexport interface UseStylesInput<Payload extends FactoryPayload> {\n name: string | (string | undefined)[]\n classes: Payload['stylesNames'] extends string ? Record<string, string> : never\n props: MaybeRefOrGetter<Payload['props']>\n stylesCtx?: MaybeRefOrGetter<Payload['ctx'] | undefined>\n className?: string | undefined
|
|
1
|
+
{"version":3,"file":"use-styles.cjs","names":["useCckTheme","useCckClassNamesPrefix","useCckWithStaticClasses","useCckIsHeadless","useStylesTransform","resolveClassNames","resolveStyles","mergeVars","resolveStyle","getClassName","getStyle"],"sources":["../../../../src/core/styles-api/use-styles/use-styles.ts"],"sourcesContent":["import {\n Attributes,\n ClassNames,\n ClassNamesArray,\n GetStylesApiOptions,\n Styles,\n} from '../styles-api.types'\nimport { PartialVarsResolver, VarsResolver } from '../create-vars-resolver/create-vars-resolver'\nimport { useStylesTransform } from './use-transformed-styles'\nimport { resolveClassNames } from './get-class-name/resolve-class-names/resolve-class-names'\nimport { resolveStyles } from './get-style/resolve-styles/resolve-styles'\nimport { mergeVars } from './get-style/resolve-vars/merge-vars'\nimport { resolveStyle } from './get-style/resolve-style/resolve-style'\nimport { getClassName } from './get-class-name/get-class-name'\nimport { Properties } from 'csstype'\nimport { getStyle } from './get-style/get-style'\nimport { FactoryPayload } from '../../factory'\nimport { CStyleProp } from '../../box'\nimport {\n useCckClassNamesPrefix,\n useCckIsHeadless,\n useCckTheme,\n useCckWithStaticClasses,\n} from '../../config-provider'\nimport { MaybeRefOrGetter, toValue } from 'vue'\n\nexport interface UseStylesInput<Payload extends FactoryPayload> {\n name: string | (string | undefined)[]\n classes: Payload['stylesNames'] extends string ? Record<string, string> : never\n props: MaybeRefOrGetter<Payload['props']>\n stylesCtx?: MaybeRefOrGetter<Payload['ctx'] | undefined>\n className?: MaybeRefOrGetter<string | undefined>\n style?: MaybeRefOrGetter<CStyleProp | undefined>\n rootSelector?: Payload['stylesNames']\n unstyled?: boolean\n classNames?: ClassNames<Payload> | ClassNamesArray<Payload>\n styles?: Styles<Payload>\n vars?: PartialVarsResolver<Payload>\n varsResolver?: VarsResolver<Payload>\n attributes?: Attributes<Payload>\n}\n\nexport type GetStylesApi<Payload extends FactoryPayload> = (\n selector: NonNullable<Payload['stylesNames']>,\n options?: GetStylesApiOptions\n) => {\n className: string\n style: Properties\n}\n\nexport function useStyles<Payload extends FactoryPayload>({\n name,\n classes,\n props,\n stylesCtx,\n className,\n style,\n rootSelector = 'root' as NonNullable<Payload['stylesNames']>,\n unstyled,\n classNames,\n styles,\n vars,\n varsResolver,\n attributes,\n}: UseStylesInput<Payload>): GetStylesApi<Payload> {\n const _theme = useCckTheme()\n const theme = _theme.value\n const classNamesPrefix = useCckClassNamesPrefix()\n const withStaticClasses = useCckWithStaticClasses()\n const headless = useCckIsHeadless()\n\n const themeNames = Array.isArray(name) ? name : [name]\n const themeName = themeNames.filter((n) => n) as string[]\n\n const { withStylesTransform, getTransformedStyles } = useStylesTransform({\n props,\n stylesCtx,\n themeName,\n theme,\n })\n\n return (selector, options) => {\n const currentProps = toValue(props) as Payload['props']\n const currentCtx = toValue(stylesCtx) as Payload['ctx'] | undefined\n const currentStyle = toValue(style) as CStyleProp | undefined\n const currentClassName = toValue(className)\n\n const resolvedClassNames = resolveClassNames({\n theme,\n classNames,\n props: currentProps,\n stylesCtx: currentCtx,\n })\n\n const resolvedThemeClassNames = themeName.map((n) =>\n resolveClassNames({\n theme,\n classNames: theme.components?.[n]?.classNames,\n props: currentProps,\n stylesCtx: currentCtx,\n })\n )\n\n const resolvedComponentStyles = withStylesTransform\n ? {}\n : resolveStyles({ theme, styles, props: currentProps, stylesCtx: currentCtx })\n\n const resolvedThemeStyles: Record<string, any> = {}\n if (!withStylesTransform) {\n for (const n of themeName) {\n const resolved = resolveStyles({\n theme,\n styles: theme.components?.[n]?.styles,\n props: currentProps,\n stylesCtx: currentCtx,\n })\n for (const key of Object.keys(resolved)) {\n resolvedThemeStyles[key] = {\n ...resolvedThemeStyles[key],\n ...resolved[key],\n }\n }\n }\n }\n\n const resolvedVars = mergeVars([\n headless ? {} : varsResolver?.(theme, currentProps, currentCtx),\n ...themeName.map((n) => theme.components?.[n]?.vars?.(theme, currentProps, currentCtx)),\n vars?.(theme, currentProps, currentCtx),\n ])\n\n const resolvedRootStyle = resolveStyle({ style: currentStyle, theme })\n\n return {\n ...attributes?.[selector],\n\n className: getClassName({\n theme,\n options,\n themeName,\n selector,\n classNamesPrefix,\n resolvedClassNames,\n resolvedThemeClassNames,\n classes,\n unstyled,\n className: currentClassName,\n rootSelector,\n props: currentProps,\n stylesCtx: currentCtx,\n withStaticClasses,\n headless,\n transformedStyles: getTransformedStyles([options?.styles, styles]),\n }),\n\n style: getStyle({\n theme,\n selector,\n options,\n props: currentProps,\n stylesCtx: currentCtx,\n rootSelector,\n withStylesTransform,\n resolvedStyles: resolvedComponentStyles,\n resolvedThemeStyles,\n resolvedVars,\n resolvedRootStyle,\n }),\n }\n }\n}\n"],"mappings":";;;;;;;;;;;AAkDA,SAAgB,UAA0C,EACxD,MACA,SACA,OACA,WACA,WACA,OACA,eAAe,QACf,UACA,YACA,QACA,MACA,cACA,c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,WAAW,CAAC,IAAI,eAAe,OAAO,cAAc,UAAU;GAC9D,GAAG,UAAU,KAAK,MAAM,MAAM,aAAa,EAAE,EAAE,OAAO,OAAO,cAAc,UAAU,CAAC;GACtF,OAAO,OAAO,cAAc,UAAU;EACxC,CAAC;EAED,MAAM,oBAAoBC,sBAAAA,aAAa;GAAE,OAAO;GAAc;EAAM,CAAC;EAErE,OAAO;GACL,GAAG,aAAa;GAEhB,WAAWC,uBAAAA,aAAa;IACtB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,WAAW;IACX;IACA,OAAO;IACP,WAAW;IACX;IACA;IACA,mBAAmB,qBAAqB,CAAC,SAAS,QAAQ,MAAM,CAAC;GACnE,CAAC;GAED,OAAOC,kBAAAA,SAAS;IACd;IACA;IACA;IACA,OAAO;IACP,WAAW;IACX;IACA;IACA,gBAAgB;IAChB;IACA;IACA;GACF,CAAC;EACH;CACF;AACF"}
|
package/cjs/index.cjs
CHANGED
|
@@ -68,18 +68,19 @@ const require_index$11 = require("./components/center/index.cjs");
|
|
|
68
68
|
const require_index$12 = require("./components/container/index.cjs");
|
|
69
69
|
const require_index$13 = require("./components/copy-button/index.cjs");
|
|
70
70
|
const require_index$14 = require("./components/empty-state/index.cjs");
|
|
71
|
-
const require_index$15 = require("./components/
|
|
72
|
-
const require_index$16 = require("./components/
|
|
73
|
-
const require_index$17 = require("./components/
|
|
74
|
-
const require_index$18 = require("./components/
|
|
75
|
-
const require_index$19 = require("./components/
|
|
76
|
-
const require_index$20 = require("./components/
|
|
77
|
-
const require_index$21 = require("./components/
|
|
78
|
-
const require_index$22 = require("./components/
|
|
79
|
-
const require_index$23 = require("./components/
|
|
80
|
-
const require_index$24 = require("./components/
|
|
81
|
-
const require_index$25 = require("./components/
|
|
82
|
-
const require_index$26 = require("./components/
|
|
71
|
+
const require_index$15 = require("./components/file-button/index.cjs");
|
|
72
|
+
const require_index$16 = require("./components/flex/index.cjs");
|
|
73
|
+
const require_index$17 = require("./components/grid/index.cjs");
|
|
74
|
+
const require_index$18 = require("./components/group/index.cjs");
|
|
75
|
+
const require_index$19 = require("./components/image/index.cjs");
|
|
76
|
+
const require_index$20 = require("./components/paper/index.cjs");
|
|
77
|
+
const require_index$21 = require("./components/semi-circle-progress/index.cjs");
|
|
78
|
+
const require_index$22 = require("./components/simple-grid/index.cjs");
|
|
79
|
+
const require_index$23 = require("./components/skeleton/index.cjs");
|
|
80
|
+
const require_index$24 = require("./components/space/index.cjs");
|
|
81
|
+
const require_index$25 = require("./components/splitter/index.cjs");
|
|
82
|
+
const require_index$26 = require("./components/stack/index.cjs");
|
|
83
|
+
const require_index$27 = require("./components/text/index.cjs");
|
|
83
84
|
let _vue_shared = require("@vue/shared");
|
|
84
85
|
//#region packages/@cck-ui/core/src/index.ts
|
|
85
86
|
const INSTALLED_KEY = Symbol("INSTALLED_KEY");
|
|
@@ -96,7 +97,7 @@ const components = [
|
|
|
96
97
|
require_index$10.CButtonGroupSection,
|
|
97
98
|
require_index$11.CCenter,
|
|
98
99
|
require_index$7.CCloseButton,
|
|
99
|
-
require_index$
|
|
100
|
+
require_index$17.CCol,
|
|
100
101
|
require_index$12.CContainer,
|
|
101
102
|
require_index$13.CCopyButton,
|
|
102
103
|
require_index$14.CEmptyState,
|
|
@@ -104,20 +105,21 @@ const components = [
|
|
|
104
105
|
require_index$14.CEmptyStateDescription,
|
|
105
106
|
require_index$14.CEmptyStateIndicator,
|
|
106
107
|
require_index$14.CEmptyStateTitle,
|
|
107
|
-
require_index$15.
|
|
108
|
-
require_index$16.
|
|
109
|
-
require_index$17.
|
|
110
|
-
require_index$18.
|
|
108
|
+
require_index$15.CFileButton,
|
|
109
|
+
require_index$16.CFlex,
|
|
110
|
+
require_index$17.CGrid,
|
|
111
|
+
require_index$18.CGroup,
|
|
112
|
+
require_index$19.CImage,
|
|
111
113
|
require_index$4.CLoader,
|
|
112
|
-
require_index$
|
|
113
|
-
require_index$
|
|
114
|
-
require_index$
|
|
115
|
-
require_index$
|
|
116
|
-
require_index$
|
|
117
|
-
require_index$
|
|
118
|
-
require_index$
|
|
119
|
-
require_index$
|
|
120
|
-
require_index$
|
|
114
|
+
require_index$20.CPaper,
|
|
115
|
+
require_index$21.CSemiCircleProgress,
|
|
116
|
+
require_index$22.CSimpleGrid,
|
|
117
|
+
require_index$23.CSkeleton,
|
|
118
|
+
require_index$24.CSpace,
|
|
119
|
+
require_index$25.CSplitter,
|
|
120
|
+
require_index$25.CSplitterPane,
|
|
121
|
+
require_index$26.CStack,
|
|
122
|
+
require_index$27.CText,
|
|
121
123
|
require_index$5.CTransition,
|
|
122
124
|
require_index$3.UnstyledButton
|
|
123
125
|
];
|
|
@@ -141,7 +143,7 @@ exports.CButtonGroupSection = require_index$10.CButtonGroupSection;
|
|
|
141
143
|
exports.CCK_TRANSITIONS = require_transitions.transitions;
|
|
142
144
|
exports.CCenter = require_index$11.CCenter;
|
|
143
145
|
exports.CCloseButton = require_index$7.CCloseButton;
|
|
144
|
-
exports.CCol = require_index$
|
|
146
|
+
exports.CCol = require_index$17.CCol;
|
|
145
147
|
exports.CContainer = require_index$12.CContainer;
|
|
146
148
|
exports.CCopyButton = require_index$13.CCopyButton;
|
|
147
149
|
exports.CDefaultLoaders = require_index$4.CDefaultLoaders;
|
|
@@ -150,21 +152,22 @@ exports.CEmptyStateActions = require_index$14.CEmptyStateActions;
|
|
|
150
152
|
exports.CEmptyStateDescription = require_index$14.CEmptyStateDescription;
|
|
151
153
|
exports.CEmptyStateIndicator = require_index$14.CEmptyStateIndicator;
|
|
152
154
|
exports.CEmptyStateTitle = require_index$14.CEmptyStateTitle;
|
|
153
|
-
exports.
|
|
154
|
-
exports.
|
|
155
|
-
exports.
|
|
156
|
-
exports.
|
|
155
|
+
exports.CFileButton = require_index$15.CFileButton;
|
|
156
|
+
exports.CFlex = require_index$16.CFlex;
|
|
157
|
+
exports.CGrid = require_index$17.CGrid;
|
|
158
|
+
exports.CGroup = require_index$18.CGroup;
|
|
159
|
+
exports.CImage = require_index$19.CImage;
|
|
157
160
|
exports.CLoader = require_index$4.CLoader;
|
|
158
161
|
exports.CONFIG_KEY = require_config_provider_types.CONFIG_KEY;
|
|
159
|
-
exports.CPaper = require_index$
|
|
160
|
-
exports.CSemiCircleProgress = require_index$
|
|
161
|
-
exports.CSimpleGrid = require_index$
|
|
162
|
-
exports.CSkeleton = require_index$
|
|
163
|
-
exports.CSpace = require_index$
|
|
164
|
-
exports.CSplitter = require_index$
|
|
165
|
-
exports.CSplitterPane = require_index$
|
|
166
|
-
exports.CStack = require_index$
|
|
167
|
-
exports.CText = require_index$
|
|
162
|
+
exports.CPaper = require_index$20.CPaper;
|
|
163
|
+
exports.CSemiCircleProgress = require_index$21.CSemiCircleProgress;
|
|
164
|
+
exports.CSimpleGrid = require_index$22.CSimpleGrid;
|
|
165
|
+
exports.CSkeleton = require_index$23.CSkeleton;
|
|
166
|
+
exports.CSpace = require_index$24.CSpace;
|
|
167
|
+
exports.CSplitter = require_index$25.CSplitter;
|
|
168
|
+
exports.CSplitterPane = require_index$25.CSplitterPane;
|
|
169
|
+
exports.CStack = require_index$26.CStack;
|
|
170
|
+
exports.CText = require_index$27.CText;
|
|
168
171
|
exports.CTransition = require_index$5.CTransition;
|
|
169
172
|
exports.CckConfigProvider = require_index$1.CckConfigProvider;
|
|
170
173
|
exports.CckUI = CckUI;
|
package/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["CckConfigProvider","CBox","CActionIcon","CActionIconGroup","CActionIconGroupSection","CAlert","CAspectRatio","CButton","CButtonGroup","CButtonGroupSection","CCenter","CCloseButton","CCol","CContainer","CCopyButton","CEmptyState","CEmptyStateActions","CEmptyStateDescription","CEmptyStateIndicator","CEmptyStateTitle","CFlex","CGrid","CGroup","CImage","CLoader","CPaper","CSemiCircleProgress","CSimpleGrid","CSkeleton","CSpace","CSplitter","CSplitterPane","CStack","CText","CTransition","UnstyledButton"],"sources":["../src/index.ts"],"sourcesContent":["import type { App, Plugin } from 'vue'\nimport {\n CActionIcon,\n CActionIconGroup,\n CActionIconGroupSection,\n CAlert,\n CAspectRatio,\n CButton,\n CButtonGroup,\n CButtonGroupSection,\n CCenter,\n CCloseButton,\n CCol,\n CContainer,\n CCopyButton,\n CEmptyState,\n CEmptyStateActions,\n CEmptyStateDescription,\n CEmptyStateIndicator,\n CEmptyStateTitle,\n CFlex,\n CGrid,\n CGroup,\n CImage,\n CLoader,\n CPaper,\n CSemiCircleProgress,\n CSimpleGrid,\n CSkeleton,\n CSpace,\n CSplitter,\n CSplitterPane,\n CStack,\n CText,\n CTransition,\n UnstyledButton,\n} from './components'\nimport { CckConfigProvider, CBox } from './core'\n\nconst INSTALLED_KEY = Symbol('INSTALLED_KEY')\n\nconst components = [\n CckConfigProvider,\n CBox,\n CActionIcon,\n CActionIconGroup,\n CActionIconGroupSection,\n CAlert,\n CAspectRatio,\n CButton,\n CButtonGroup,\n CButtonGroupSection,\n CCenter,\n CCloseButton,\n CCol,\n CContainer,\n CCopyButton,\n CEmptyState,\n CEmptyStateActions,\n CEmptyStateDescription,\n CEmptyStateIndicator,\n CEmptyStateTitle,\n CFlex,\n CGrid,\n CGroup,\n CImage,\n CLoader,\n CPaper,\n CSemiCircleProgress,\n CSimpleGrid,\n CSkeleton,\n CSpace,\n CSplitter,\n CSplitterPane,\n CStack,\n CText,\n CTransition,\n UnstyledButton,\n]\n\nconst CckUI: Plugin = {\n install(app: App) {\n if ((app as any)[INSTALLED_KEY]) {\n return\n }\n ;(app as any)[INSTALLED_KEY] = true\n components.forEach((c) => {\n if (c.name) {\n app.component(c.name, c)\n }\n })\n },\n}\n\nexport default CckUI\nexport { CckUI }\n\nexport * from './components'\nexport * from './core'\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["CckConfigProvider","CBox","CActionIcon","CActionIconGroup","CActionIconGroupSection","CAlert","CAspectRatio","CButton","CButtonGroup","CButtonGroupSection","CCenter","CCloseButton","CCol","CContainer","CCopyButton","CEmptyState","CEmptyStateActions","CEmptyStateDescription","CEmptyStateIndicator","CEmptyStateTitle","CFileButton","CFlex","CGrid","CGroup","CImage","CLoader","CPaper","CSemiCircleProgress","CSimpleGrid","CSkeleton","CSpace","CSplitter","CSplitterPane","CStack","CText","CTransition","UnstyledButton"],"sources":["../src/index.ts"],"sourcesContent":["import type { App, Plugin } from 'vue'\nimport {\n CActionIcon,\n CActionIconGroup,\n CActionIconGroupSection,\n CAlert,\n CAspectRatio,\n CButton,\n CButtonGroup,\n CButtonGroupSection,\n CCenter,\n CCloseButton,\n CCol,\n CContainer,\n CCopyButton,\n CEmptyState,\n CEmptyStateActions,\n CEmptyStateDescription,\n CEmptyStateIndicator,\n CEmptyStateTitle,\n CFileButton,\n CFlex,\n CGrid,\n CGroup,\n CImage,\n CLoader,\n CPaper,\n CSemiCircleProgress,\n CSimpleGrid,\n CSkeleton,\n CSpace,\n CSplitter,\n CSplitterPane,\n CStack,\n CText,\n CTransition,\n UnstyledButton,\n} from './components'\nimport { CckConfigProvider, CBox } from './core'\n\nconst INSTALLED_KEY = Symbol('INSTALLED_KEY')\n\nconst components = [\n CckConfigProvider,\n CBox,\n CActionIcon,\n CActionIconGroup,\n CActionIconGroupSection,\n CAlert,\n CAspectRatio,\n CButton,\n CButtonGroup,\n CButtonGroupSection,\n CCenter,\n CCloseButton,\n CCol,\n CContainer,\n CCopyButton,\n CEmptyState,\n CEmptyStateActions,\n CEmptyStateDescription,\n CEmptyStateIndicator,\n CEmptyStateTitle,\n CFileButton,\n CFlex,\n CGrid,\n CGroup,\n CImage,\n CLoader,\n CPaper,\n CSemiCircleProgress,\n CSimpleGrid,\n CSkeleton,\n CSpace,\n CSplitter,\n CSplitterPane,\n CStack,\n CText,\n CTransition,\n UnstyledButton,\n]\n\nconst CckUI: Plugin = {\n install(app: App) {\n if ((app as any)[INSTALLED_KEY]) {\n return\n }\n ;(app as any)[INSTALLED_KEY] = true\n components.forEach((c) => {\n if (c.name) {\n app.component(c.name, c)\n }\n })\n },\n}\n\nexport default CckUI\nexport { CckUI }\n\nexport * from './components'\nexport * from './core'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,MAAM,gBAAgB,OAAO,eAAe;AAE5C,MAAM,aAAa;CACjBA,gBAAAA;CACAC,gBAAAA;CACAC,gBAAAA;CACAC,gBAAAA;CACAC,gBAAAA;CACAC,gBAAAA;CACAC,gBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,gBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,gBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,gBAAAA;CACAC,gBAAAA;AACF;AAEA,MAAM,QAAgB,EACpB,QAAQ,KAAU;CAChB,IAAK,IAAY,gBACf;CAED,IAAa,iBAAiB;CAC/B,WAAW,SAAS,MAAM;EACxB,IAAI,EAAE,MACJ,IAAI,UAAU,EAAE,MAAM,CAAC;CAE3B,CAAC;AACH,EACF"}
|
|
@@ -340,8 +340,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
340
340
|
name: "ActionIconGroup",
|
|
341
341
|
props: styleProps,
|
|
342
342
|
classes: action_icon_module_default,
|
|
343
|
-
className: props.value.className,
|
|
344
|
-
style: props.value.style,
|
|
343
|
+
className: () => props.value.className,
|
|
344
|
+
style: () => props.value.style,
|
|
345
345
|
classNames: props.value.classNames,
|
|
346
346
|
styles: props.value.styles,
|
|
347
347
|
unstyled: props.value.unstyled,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-icon-group.mjs","names":[],"sources":["../../../../src/components/action-icon/action-icon-group/action-icon-group.vue"],"sourcesContent":["<template>\n <c-box ref=\"_group\" role=\"group\" v-bind=\"mergedAttrs\">\n <slot />\n </c-box>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs } from 'vue'\nimport { CBox, CStyleProp, useComponentProps, useStyles } from '../../../core'\nimport { ActionIconGroupFactory, ActionIconGroupProps } from './action-icon-group.types'\nimport classes from '../action-icon.module.css'\nimport { varsResolver } from './action-icon-group.utils'\n\ndefineOptions({\n name: 'CActionIconGroup',\n})\n\nconst _group = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<ActionIconGroupProps>()\n\nconst defaultProps = {\n orientation: 'horizontal',\n} satisfies Partial<ActionIconGroupProps>\n\nconst props = useComponentProps({\n component: 'CActionIconGroup',\n defaultProps,\n props: rawProps,\n})\n\nconst knownProps = [\n 'className',\n 'style',\n 'classNames',\n 'styles',\n 'unstyled',\n 'orientation',\n 'vars',\n 'borderWidth',\n 'mod',\n 'attributes',\n]\n\nconst styleProps = computed(() => ({\n ...props.value,\n ...attrs,\n style: (attrs.style ?? props.value.style) as CStyleProp,\n}))\n\nconst getStyles = useStyles<ActionIconGroupFactory>({\n name: 'ActionIconGroup',\n props: styleProps,\n classes,\n className: props.value.className,\n style: props.value.style,\n classNames: props.value.classNames,\n styles: props.value.styles,\n unstyled: props.value.unstyled,\n attributes: props.value.attributes,\n vars: props.value.vars,\n varsResolver,\n rootSelector: 'group',\n})\n\nconst modList = computed(() => [\n {\n orientation: props.value.orientation,\n },\n])\n\nconst groupAttrs = computed(() => getStyles('group'))\nconst mergedAttrs = computed(() => {\n const others: Record<string, any> = {}\n const propsValue = props.value\n for (const key in propsValue) {\n if (!knownProps.includes(key)) {\n others[key] = propsValue[key as keyof typeof propsValue]\n }\n }\n const userMod = props.value.mod\n const mergedMod = [\n ...(Array.isArray(userMod) ? userMod : [userMod].filter(Boolean)),\n ...(modList.value || []),\n ]\n return { ...others, mod: mergedMod, ...groupAttrs.value }\n})\n\ndefineExpose({\n group: computed(() => _group.value?.root ?? null),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBA,MAAM,SAAS,IAAsC,IAAI;EAEzD,MAAM,QAAQ,SAAS;EAEvB,MAAM,WAAW;EAEjB,MAAM,eAAe,EACnB,aAAa,aACf;EAEA,MAAM,QAAQ,kBAAkB;GAC9B,WAAW;GACX;GACA,OAAO;EACT,CAAC;EAED,MAAM,aAAa;GACjB;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;EAEA,MAAM,aAAa,gBAAgB;GACjC,GAAG,MAAM;GACT,GAAG;GACH,OAAQ,MAAM,SAAS,MAAM,MAAM;EACrC,EAAE;EAEF,MAAM,YAAY,UAAkC;GAClD,MAAM;GACN,OAAO;GACP,SAAA;GACA,
|
|
1
|
+
{"version":3,"file":"action-icon-group.mjs","names":[],"sources":["../../../../src/components/action-icon/action-icon-group/action-icon-group.vue"],"sourcesContent":["<template>\n <c-box ref=\"_group\" role=\"group\" v-bind=\"mergedAttrs\">\n <slot />\n </c-box>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs } from 'vue'\nimport { CBox, CStyleProp, useComponentProps, useStyles } from '../../../core'\nimport { ActionIconGroupFactory, ActionIconGroupProps } from './action-icon-group.types'\nimport classes from '../action-icon.module.css'\nimport { varsResolver } from './action-icon-group.utils'\n\ndefineOptions({\n name: 'CActionIconGroup',\n})\n\nconst _group = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<ActionIconGroupProps>()\n\nconst defaultProps = {\n orientation: 'horizontal',\n} satisfies Partial<ActionIconGroupProps>\n\nconst props = useComponentProps({\n component: 'CActionIconGroup',\n defaultProps,\n props: rawProps,\n})\n\nconst knownProps = [\n 'className',\n 'style',\n 'classNames',\n 'styles',\n 'unstyled',\n 'orientation',\n 'vars',\n 'borderWidth',\n 'mod',\n 'attributes',\n]\n\nconst styleProps = computed(() => ({\n ...props.value,\n ...attrs,\n style: (attrs.style ?? props.value.style) as CStyleProp,\n}))\n\nconst getStyles = useStyles<ActionIconGroupFactory>({\n name: 'ActionIconGroup',\n props: styleProps,\n classes,\n className: () => props.value.className,\n style: () => props.value.style,\n classNames: props.value.classNames,\n styles: props.value.styles,\n unstyled: props.value.unstyled,\n attributes: props.value.attributes,\n vars: props.value.vars,\n varsResolver,\n rootSelector: 'group',\n})\n\nconst modList = computed(() => [\n {\n orientation: props.value.orientation,\n },\n])\n\nconst groupAttrs = computed(() => getStyles('group'))\nconst mergedAttrs = computed(() => {\n const others: Record<string, any> = {}\n const propsValue = props.value\n for (const key in propsValue) {\n if (!knownProps.includes(key)) {\n others[key] = propsValue[key as keyof typeof propsValue]\n }\n }\n const userMod = props.value.mod\n const mergedMod = [\n ...(Array.isArray(userMod) ? userMod : [userMod].filter(Boolean)),\n ...(modList.value || []),\n ]\n return { ...others, mod: mergedMod, ...groupAttrs.value }\n})\n\ndefineExpose({\n group: computed(() => _group.value?.root ?? null),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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5B,MAAM,YAAY,CAChB,GAAI,MAAM,QAAQ,OAAO,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC,OAAO,OAAO,GAC/D,GAAI,QAAQ,SAAS,CAAC,CACxB;GACA,OAAO;IAAE,GAAG;IAAQ,KAAK;IAAW,GAAG,WAAW;GAAM;EAC1D,CAAC;EAED,SAAa,EACX,OAAO,eAAe,OAAO,OAAO,QAAQ,IAAI,EAClD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;qBA3FC,YAEQ,OAAA,SAFR,WAEQ;EAFD,KAAI;EAAS,MAAK;IAAgB,OAAA,WAAW,GAAA;yBAC1C,CAAR,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA"}
|
|
@@ -351,8 +351,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
351
351
|
name: "ActionIconGroupSection",
|
|
352
352
|
props: styleProps,
|
|
353
353
|
classes: action_icon_module_default,
|
|
354
|
-
className: props.value.className,
|
|
355
|
-
style: props.value.style,
|
|
354
|
+
className: () => props.value.className,
|
|
355
|
+
style: () => props.value.style,
|
|
356
356
|
classNames: props.value.classNames,
|
|
357
357
|
styles: props.value.styles,
|
|
358
358
|
unstyled: props.value.unstyled,
|
package/esm/components/action-icon/action-icon-group-section/action-icon-group-section.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-icon-group-section.mjs","names":[],"sources":["../../../../src/components/action-icon/action-icon-group-section/action-icon-group-section.vue"],"sourcesContent":["<template>\n <c-box ref=\"_section\" v-bind=\"mergedAttrs\">\n <slot />\n </c-box>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs } from 'vue'\nimport { CBox, CStyleProp, useComponentProps, useStyles } from '../../../core'\nimport classes from '../action-icon.module.css'\nimport {\n ActionIconGroupSectionFactory,\n ActionIconGroupSectionProps,\n} from './action-icon-group-section.types'\nimport { varsResolver } from './action-icon-group-section.utils'\n\ndefineOptions({\n name: 'CActionIconGroupSection',\n})\n\nconst _section = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<ActionIconGroupSectionProps>()\n\nconst props = useComponentProps({\n component: 'CActionIconGroupSection',\n defaultProps: {},\n props: rawProps,\n})\n\nconst knownProps = [\n 'className',\n 'style',\n 'classNames',\n 'styles',\n 'unstyled',\n 'vars',\n 'gradient',\n 'radius',\n 'autoContrast',\n 'attributes',\n]\n\nconst styleProps = computed(() => ({\n ...props.value,\n ...attrs,\n style: (attrs.style ?? props.value.style) as CStyleProp,\n}))\n\nconst getStyles = useStyles<ActionIconGroupSectionFactory>({\n name: 'ActionIconGroupSection',\n props: styleProps,\n classes,\n className: props.value.className,\n style: props.value.style,\n classNames: props.value.classNames,\n styles: props.value.styles,\n unstyled: props.value.unstyled,\n attributes: props.value.attributes,\n vars: props.value.vars,\n varsResolver,\n rootSelector: 'groupSection',\n})\n\nconst sectionAttrs = computed(() => getStyles('groupSection'))\nconst mergedAttrs = computed(() => {\n const others: Record<string, any> = {}\n const propsValue = props.value\n for (const key in propsValue) {\n if (!knownProps.includes(key)) {\n others[key] = propsValue[key as keyof typeof propsValue]\n }\n }\n const userMod = props.value.mod\n const mergedMod = [...(Array.isArray(userMod) ? userMod : [userMod].filter(Boolean))]\n return { ...others, mod: mergedMod, ...sectionAttrs.value }\n})\n\ndefineExpose({\n section: computed(() => _section.value?.root ?? null),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoBA,MAAM,WAAW,IAAsC,IAAI;EAE3D,MAAM,QAAQ,SAAS;EAEvB,MAAM,WAAW;EAEjB,MAAM,QAAQ,kBAAkB;GAC9B,WAAW;GACX,cAAc,CAAC;GACf,OAAO;EACT,CAAC;EAED,MAAM,aAAa;GACjB;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;EAEA,MAAM,aAAa,gBAAgB;GACjC,GAAG,MAAM;GACT,GAAG;GACH,OAAQ,MAAM,SAAS,MAAM,MAAM;EACrC,EAAE;EAEF,MAAM,YAAY,UAAyC;GACzD,MAAM;GACN,OAAO;GACP,SAAA;GACA,
|
|
1
|
+
{"version":3,"file":"action-icon-group-section.mjs","names":[],"sources":["../../../../src/components/action-icon/action-icon-group-section/action-icon-group-section.vue"],"sourcesContent":["<template>\n <c-box ref=\"_section\" v-bind=\"mergedAttrs\">\n <slot />\n </c-box>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs } from 'vue'\nimport { CBox, CStyleProp, useComponentProps, useStyles } from '../../../core'\nimport classes from '../action-icon.module.css'\nimport {\n ActionIconGroupSectionFactory,\n ActionIconGroupSectionProps,\n} from './action-icon-group-section.types'\nimport { varsResolver } from './action-icon-group-section.utils'\n\ndefineOptions({\n name: 'CActionIconGroupSection',\n})\n\nconst _section = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<ActionIconGroupSectionProps>()\n\nconst props = useComponentProps({\n component: 'CActionIconGroupSection',\n defaultProps: {},\n props: rawProps,\n})\n\nconst knownProps = [\n 'className',\n 'style',\n 'classNames',\n 'styles',\n 'unstyled',\n 'vars',\n 'gradient',\n 'radius',\n 'autoContrast',\n 'attributes',\n]\n\nconst styleProps = computed(() => ({\n ...props.value,\n ...attrs,\n style: (attrs.style ?? props.value.style) as CStyleProp,\n}))\n\nconst getStyles = useStyles<ActionIconGroupSectionFactory>({\n name: 'ActionIconGroupSection',\n props: styleProps,\n classes,\n className: () => props.value.className,\n style: () => props.value.style,\n classNames: props.value.classNames,\n styles: props.value.styles,\n unstyled: props.value.unstyled,\n attributes: props.value.attributes,\n vars: props.value.vars,\n varsResolver,\n rootSelector: 'groupSection',\n})\n\nconst sectionAttrs = computed(() => getStyles('groupSection'))\nconst mergedAttrs = computed(() => {\n const others: Record<string, any> = {}\n const propsValue = props.value\n for (const key in propsValue) {\n if (!knownProps.includes(key)) {\n others[key] = propsValue[key as keyof typeof propsValue]\n }\n }\n const userMod = props.value.mod\n const mergedMod = [...(Array.isArray(userMod) ? userMod : [userMod].filter(Boolean))]\n return { ...others, mod: mergedMod, ...sectionAttrs.value }\n})\n\ndefineExpose({\n section: computed(() => _section.value?.root ?? null),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoBA,MAAM,WAAW,IAAsC,IAAI;EAE3D,MAAM,QAAQ,SAAS;EAEvB,MAAM,WAAW;EAEjB,MAAM,QAAQ,kBAAkB;GAC9B,WAAW;GACX,cAAc,CAAC;GACf,OAAO;EACT,CAAC;EAED,MAAM,aAAa;GACjB;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;EAEA,MAAM,aAAa,gBAAgB;GACjC,GAAG,MAAM;GACT,GAAG;GACH,OAAQ,MAAM,SAAS,MAAM,MAAM;EACrC,EAAE;EAEF,MAAM,YAAY,UAAyC;GACzD,MAAM;GACN,OAAO;GACP,SAAA;GACA,iBAAiB,MAAM,MAAM;GAC7B,aAAa,MAAM,MAAM;GACzB,YAAY,MAAM,MAAM;GACxB,QAAQ,MAAM,MAAM;GACpB,UAAU,MAAM,MAAM;GACtB,YAAY,MAAM,MAAM;GACxB,MAAM,MAAM,MAAM;GAClB;GACA,cAAc;EAChB,CAAC;EAED,MAAM,eAAe,eAAe,UAAU,cAAc,CAAC;EAC7D,MAAM,cAAc,eAAe;GACjC,MAAM,SAA8B,CAAC;GACrC,MAAM,aAAa,MAAM;GACzB,KAAK,MAAM,OAAO,YAChB,IAAI,CAAC,WAAW,SAAS,GAAG,GAC1B,OAAO,OAAO,WAAW;GAG7B,MAAM,UAAU,MAAM,MAAM;GAC5B,MAAM,YAAY,CAAC,GAAI,MAAM,QAAQ,OAAO,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC,OAAO,OAAO,CAAE;GACpF,OAAO;IAAE,GAAG;IAAQ,KAAK;IAAW,GAAG,aAAa;GAAM;EAC5D,CAAC;EAED,SAAa,EACX,SAAS,eAAe,SAAS,OAAO,QAAQ,IAAI,EACtD,CAAC;;;;;;;;;;;;;;;;;;;;;;;qBAjFC,YAEQ,OAAA,SAFR,WAEQ,EAFD,KAAI,WAAU,GAAS,OAAA,WAAW,GAAA;yBAC/B,CAAR,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA"}
|
|
@@ -383,8 +383,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
383
383
|
name: ["ActionIcon", props.value.__staticSelector],
|
|
384
384
|
props: styleProps,
|
|
385
385
|
classes: action_icon_module_default,
|
|
386
|
-
className: props.value.className,
|
|
387
|
-
style: props.value.style,
|
|
386
|
+
className: () => props.value.className,
|
|
387
|
+
style: () => props.value.style,
|
|
388
388
|
classNames: props.value.classNames,
|
|
389
389
|
styles: props.value.styles,
|
|
390
390
|
unstyled: props.value.unstyled,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-icon.mjs","names":[],"sources":["../../../src/components/action-icon/action-icon.vue"],"sourcesContent":["<template>\n <unstyled-button\n ref=\"_root\"\n v-bind=\"mergedRootAttrs\"\n :aria-busy=\"props.loading || undefined\"\n :disabled=\"props.disabled || props.loading\"\n :size=\"props.size\"\n :unstyled=\"props.unstyled\"\n >\n <c-transition\n transition=\"slide-down\"\n v-if=\"typeof props.loading === 'boolean'\"\n :duration=\"150\"\n :mounted=\"props.loading\"\n >\n <template #default=\"{ styles }\">\n <c-box\n aria-hidden=\"true\"\n ref=\"_inner\"\n tag=\"span\"\n v-bind=\"getStyles('loader', { style: styles })\"\n >\n <c-loader\n color=\"var(--ai-color)\"\n size=\"calc(var(--ai-size) * 0.55)\"\n v-bind=\"props.loaderProps\"\n ></c-loader>\n </c-box>\n </template>\n </c-transition>\n\n <c-box tag=\"span\" v-bind=\"getStyles('icon')\" :mod=\"{ loading: props.loading }\">\n <slot />\n </c-box>\n </unstyled-button>\n</template>\n\n<script setup lang=\"ts\">\nimport UnstyledButton from '../unstyled-button'\nimport { CLoader } from '../loader'\nimport { CTransition } from '../transition'\nimport { computed, ref, useAttrs } from 'vue'\nimport { ActionIconFactory, ActionIconProps } from './action-icon.types'\nimport { CBox, CStyleProp, useComponentProps, useStyles } from '../../core'\nimport classes from './action-icon.module.css'\nimport { varsResolver } from './action-icon.utils'\n\ndefineOptions({\n name: 'CActionIcon',\n})\n\nconst _root = ref<InstanceType<typeof UnstyledButton> | null>(null)\nconst _inner = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<ActionIconProps>()\n\nconst props = useComponentProps({\n component: 'CActionIcon',\n defaultProps: {},\n props: rawProps,\n})\n\nconst knownProps = [\n 'className',\n 'classNames',\n 'style',\n 'styles',\n 'unstyled',\n 'loading',\n 'loaderProps',\n 'size',\n 'color',\n 'radius',\n '__staticSelector',\n 'gradient',\n 'vars',\n 'disabled',\n 'dataDisabled',\n 'autoContrast',\n 'mod',\n 'attributes',\n]\n\nconst styleProps = computed(() => ({\n ...props.value,\n ...attrs,\n style: (attrs.style ?? props.value.style) as CStyleProp,\n}))\n\nconst getStyles = useStyles<ActionIconFactory>({\n name: ['ActionIcon', props.value.__staticSelector],\n props: styleProps,\n classes,\n className: props.value.className,\n style: props.value.style,\n classNames: props.value.classNames,\n styles: props.value.styles,\n unstyled: props.value.unstyled,\n attributes: props.value.attributes,\n vars: props.value.vars,\n varsResolver,\n})\n\nconst modList = computed(() => [\n { disabled: props.value.disabled || props.value.dataDisabled },\n { loading: props.value.loading },\n])\n\nconst rootAttrs = computed(() =>\n getStyles('root', {\n active: !props.value.disabled && !props.value.loading && !props.value.dataDisabled,\n })\n)\n\nconst mergedRootAttrs = computed(() => {\n const others: Record<string, any> = {}\n const propsValue = props.value\n for (const key in propsValue) {\n if (!knownProps.includes(key)) {\n others[key] = propsValue[key as keyof typeof propsValue]\n }\n }\n const userMod = props.value.mod\n const mergedMod = [\n ...(Array.isArray(userMod) ? userMod : [userMod].filter(Boolean)),\n ...(modList.value || []),\n ]\n return { ...others, mod: mergedMod, ...rootAttrs.value }\n})\n\ndefineExpose({\n root: computed(() => _root.value?.root ?? null),\n inner: computed(() => _inner.value?.root ?? null),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmDA,MAAM,QAAQ,IAAgD,IAAI;EAClE,MAAM,SAAS,IAAsC,IAAI;EAEzD,MAAM,QAAQ,SAAS;EAEvB,MAAM,WAAW;EAEjB,MAAM,QAAQ,kBAAkB;GAC9B,WAAW;GACX,cAAc,CAAC;GACf,OAAO;EACT,CAAC;EAED,MAAM,aAAa;GACjB;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;EAEA,MAAM,aAAa,gBAAgB;GACjC,GAAG,MAAM;GACT,GAAG;GACH,OAAQ,MAAM,SAAS,MAAM,MAAM;EACrC,EAAE;EAEF,MAAM,YAAY,UAA6B;GAC7C,MAAM,CAAC,cAAc,MAAM,MAAM,gBAAgB;GACjD,OAAO;GACP,SAAA;GACA,
|
|
1
|
+
{"version":3,"file":"action-icon.mjs","names":[],"sources":["../../../src/components/action-icon/action-icon.vue"],"sourcesContent":["<template>\n <unstyled-button\n ref=\"_root\"\n v-bind=\"mergedRootAttrs\"\n :aria-busy=\"props.loading || undefined\"\n :disabled=\"props.disabled || props.loading\"\n :size=\"props.size\"\n :unstyled=\"props.unstyled\"\n >\n <c-transition\n transition=\"slide-down\"\n v-if=\"typeof props.loading === 'boolean'\"\n :duration=\"150\"\n :mounted=\"props.loading\"\n >\n <template #default=\"{ styles }\">\n <c-box\n aria-hidden=\"true\"\n ref=\"_inner\"\n tag=\"span\"\n v-bind=\"getStyles('loader', { style: styles })\"\n >\n <c-loader\n color=\"var(--ai-color)\"\n size=\"calc(var(--ai-size) * 0.55)\"\n v-bind=\"props.loaderProps\"\n ></c-loader>\n </c-box>\n </template>\n </c-transition>\n\n <c-box tag=\"span\" v-bind=\"getStyles('icon')\" :mod=\"{ loading: props.loading }\">\n <slot />\n </c-box>\n </unstyled-button>\n</template>\n\n<script setup lang=\"ts\">\nimport UnstyledButton from '../unstyled-button'\nimport { CLoader } from '../loader'\nimport { CTransition } from '../transition'\nimport { computed, ref, useAttrs } from 'vue'\nimport { ActionIconFactory, ActionIconProps } from './action-icon.types'\nimport { CBox, CStyleProp, useComponentProps, useStyles } from '../../core'\nimport classes from './action-icon.module.css'\nimport { varsResolver } from './action-icon.utils'\n\ndefineOptions({\n name: 'CActionIcon',\n})\n\nconst _root = ref<InstanceType<typeof UnstyledButton> | null>(null)\nconst _inner = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<ActionIconProps>()\n\nconst props = useComponentProps({\n component: 'CActionIcon',\n defaultProps: {},\n props: rawProps,\n})\n\nconst knownProps = [\n 'className',\n 'classNames',\n 'style',\n 'styles',\n 'unstyled',\n 'loading',\n 'loaderProps',\n 'size',\n 'color',\n 'radius',\n '__staticSelector',\n 'gradient',\n 'vars',\n 'disabled',\n 'dataDisabled',\n 'autoContrast',\n 'mod',\n 'attributes',\n]\n\nconst styleProps = computed(() => ({\n ...props.value,\n ...attrs,\n style: (attrs.style ?? props.value.style) as CStyleProp,\n}))\n\nconst getStyles = useStyles<ActionIconFactory>({\n name: ['ActionIcon', props.value.__staticSelector],\n props: styleProps,\n classes,\n className: () => props.value.className,\n style: () => props.value.style,\n classNames: props.value.classNames,\n styles: props.value.styles,\n unstyled: props.value.unstyled,\n attributes: props.value.attributes,\n vars: props.value.vars,\n varsResolver,\n})\n\nconst modList = computed(() => [\n { disabled: props.value.disabled || props.value.dataDisabled },\n { loading: props.value.loading },\n])\n\nconst rootAttrs = computed(() =>\n getStyles('root', {\n active: !props.value.disabled && !props.value.loading && !props.value.dataDisabled,\n })\n)\n\nconst mergedRootAttrs = computed(() => {\n const others: Record<string, any> = {}\n const propsValue = props.value\n for (const key in propsValue) {\n if (!knownProps.includes(key)) {\n others[key] = propsValue[key as keyof typeof propsValue]\n }\n }\n const userMod = props.value.mod\n const mergedMod = [\n ...(Array.isArray(userMod) ? userMod : [userMod].filter(Boolean)),\n ...(modList.value || []),\n ]\n return { ...others, mod: mergedMod, ...rootAttrs.value }\n})\n\ndefineExpose({\n root: computed(() => _root.value?.root ?? null),\n inner: computed(() => _inner.value?.root ?? null),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmDA,MAAM,QAAQ,IAAgD,IAAI;EAClE,MAAM,SAAS,IAAsC,IAAI;EAEzD,MAAM,QAAQ,SAAS;EAEvB,MAAM,WAAW;EAEjB,MAAM,QAAQ,kBAAkB;GAC9B,WAAW;GACX,cAAc,CAAC;GACf,OAAO;EACT,CAAC;EAED,MAAM,aAAa;GACjB;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;EAEA,MAAM,aAAa,gBAAgB;GACjC,GAAG,MAAM;GACT,GAAG;GACH,OAAQ,MAAM,SAAS,MAAM,MAAM;EACrC,EAAE;EAEF,MAAM,YAAY,UAA6B;GAC7C,MAAM,CAAC,cAAc,MAAM,MAAM,gBAAgB;GACjD,OAAO;GACP,SAAA;GACA,iBAAiB,MAAM,MAAM;GAC7B,aAAa,MAAM,MAAM;GACzB,YAAY,MAAM,MAAM;GACxB,QAAQ,MAAM,MAAM;GACpB,UAAU,MAAM,MAAM;GACtB,YAAY,MAAM,MAAM;GACxB,MAAM,MAAM,MAAM;GAClB;EACF,CAAC;EAED,MAAM,UAAU,eAAe,CAC7B,EAA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AAA,EAAA,OAAoB,OAAM,CAAA,CAAA,GAAA;2BAM/B,CAJZ,YAIY,OAAA,YAJZ,WAIY;KAHV,OAAM;KACN,MAAK;OACG,OAAA,MAAM,WAAW,GAAA,MAAA,EAAA,CAAA,CAAA;;;;0DAMjC,YAEQ,OAAA,SAFR,WAEQ,EAFD,KAAI,OAAM,GAAS,OAAA,UAAS,MAAA,GAAA,EAAW,KAAG,EAAA,SAAa,OAAA,MAAM,QAAO,EAAA,CAAA,GAAA;0BACjE,CAAR,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA"}
|
|
@@ -364,8 +364,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
364
364
|
name: "Alert",
|
|
365
365
|
props: styleProps,
|
|
366
366
|
classes: alert_module_default,
|
|
367
|
-
className: props.value.className,
|
|
368
|
-
style: props.value.style,
|
|
367
|
+
className: () => props.value.className,
|
|
368
|
+
style: () => props.value.style,
|
|
369
369
|
classNames: props.value.classNames,
|
|
370
370
|
styles: props.value.styles,
|
|
371
371
|
unstyled: props.value.unstyled,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert.mjs","names":[],"sources":["../../../src/components/alert/alert.vue"],"sourcesContent":["<template>\n <c-box\n ref=\"_root\"\n v-bind=\"mergedRootAttrs\"\n :aria-describedby=\"$slots.default ? bodyId : undefined\"\n :aria-labelledby=\"$slots.title ? titleId : undefined\"\n :id=\"rootId\"\n :role=\"props.role || 'alert'\"\n :variant=\"props.variant\"\n >\n <c-box v-bind=\"wrapperAttrs\">\n <c-box v-bind=\"iconAttrs\" v-if=\"$slots.icon\">\n <slot name=\"icon\" />\n </c-box>\n\n <c-box v-bind=\"bodyAttrs\">\n <c-box\n v-bind=\"titleAttrs\"\n v-if=\"$slots.title\"\n :data-with-close-button=\"props.withCloseButton || undefined\"\n >\n <c-box tag=\"span\" :id=\"titleId\" v-bind=\"labelAttrs\">\n <slot name=\"title\" />\n </c-box>\n </c-box>\n\n <c-box\n v-bind=\"messageAttrs\"\n v-if=\"$slots.default\"\n :data-variant=\"props.variant\"\n :id=\"bodyId\"\n >\n <slot />\n </c-box>\n </c-box>\n\n <c-close-button\n v-bind=\"closeButtonAttrs\"\n v-if=\"props.withCloseButton\"\n :aria-label=\"closeButtonLabel\"\n :icon-size=\"16\"\n :size=\"16\"\n :unstyled=\"props.unstyled\"\n variant=\"transparent\"\n @click=\"props.onClose\"\n ></c-close-button>\n </c-box>\n </c-box>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs } from 'vue'\nimport { useId } from '@cck-ui/hooks'\nimport { CBox, CStyleProp, useComponentProps, useStyles } from '../../core'\nimport classes from './alert.module.css'\nimport { AlertFactory, type AlertProps } from './alert.types'\nimport { varsResolver } from './alert.utils'\nimport CCloseButton from '../close-button'\n\ndefineOptions({\n name: 'CAlert',\n})\n\nconst slots = defineSlots<{\n default: any\n icon: any\n title: any\n}>()\n\nconst _root = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<AlertProps>()\n\nconst props = useComponentProps({\n component: 'CAlert',\n defaultProps: {},\n props: rawProps,\n})\n\nconst knownProps = [\n 'style',\n 'className',\n 'styles',\n 'classNames',\n 'unstyled',\n 'vars',\n 'radius',\n 'color',\n 'id',\n 'withCloseButton',\n 'onClose',\n 'closeButtonLabel',\n 'variant',\n 'autoContrast',\n 'role',\n 'attributes',\n]\n\nconst styleProps = computed(() => ({\n ...props.value,\n ...attrs,\n style: (attrs.style ?? props.value.style) as CStyleProp,\n}))\n\nconst getStyles = useStyles<AlertFactory>({\n name: 'Alert',\n props: styleProps,\n classes,\n className: props.value.className,\n style: props.value.style,\n classNames: props.value.classNames,\n styles: props.value.styles,\n unstyled: props.value.unstyled,\n attributes: props.value.attributes,\n vars: props.value.vars,\n varsResolver,\n})\n\nconst rootId = useId(props.value.id).value\nconst titleId = (slots.title && `${rootId}-title`) || undefined\nconst bodyId = `${rootId}-body`\n\nconst rootAttrs = computed(() => getStyles('root'))\nconst wrapperAttrs = computed(() => getStyles('wrapper'))\nconst iconAttrs = computed(() => getStyles('icon'))\nconst bodyAttrs = computed(() => getStyles('body'))\nconst titleAttrs = computed(() => getStyles('title'))\nconst labelAttrs = computed(() => getStyles('label'))\nconst messageAttrs = computed(() => getStyles('message'))\nconst closeButtonAttrs = computed(() => getStyles('close-button'))\n\nconst mergedRootAttrs = computed(() => {\n const others: Record<string, any> = {}\n const propsValue = props.value\n for (const key in propsValue) {\n if (!knownProps.includes(key)) {\n others[key] = propsValue[key as keyof typeof propsValue]\n }\n }\n const userMod = props.value.mod\n const mergedMod = [...(Array.isArray(userMod) ? userMod : [userMod])]\n return { ...others, mod: mergedMod, ...rootAttrs.value }\n})\n\ndefineExpose({\n root: computed(() => _root.value?.root ?? null),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+DA,MAAM,QAAQ,SAAA;EAMd,MAAM,QAAQ,IAAsC,IAAI;EAExD,MAAM,QAAQ,SAAS;EAEvB,MAAM,WAAW;EAEjB,MAAM,QAAQ,kBAAkB;GAC9B,WAAW;GACX,cAAc,CAAC;GACf,OAAO;EACT,CAAC;EAED,MAAM,aAAa;GACjB;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;EAEA,MAAM,aAAa,gBAAgB;GACjC,GAAG,MAAM;GACT,GAAG;GACH,OAAQ,MAAM,SAAS,MAAM,MAAM;EACrC,EAAE;EAEF,MAAM,YAAY,UAAwB;GACxC,MAAM;GACN,OAAO;GACP,SAAA;GACA,
|
|
1
|
+
{"version":3,"file":"alert.mjs","names":[],"sources":["../../../src/components/alert/alert.vue"],"sourcesContent":["<template>\n <c-box\n ref=\"_root\"\n v-bind=\"mergedRootAttrs\"\n :aria-describedby=\"$slots.default ? bodyId : undefined\"\n :aria-labelledby=\"$slots.title ? titleId : undefined\"\n :id=\"rootId\"\n :role=\"props.role || 'alert'\"\n :variant=\"props.variant\"\n >\n <c-box v-bind=\"wrapperAttrs\">\n <c-box v-bind=\"iconAttrs\" v-if=\"$slots.icon\">\n <slot name=\"icon\" />\n </c-box>\n\n <c-box v-bind=\"bodyAttrs\">\n <c-box\n v-bind=\"titleAttrs\"\n v-if=\"$slots.title\"\n :data-with-close-button=\"props.withCloseButton || undefined\"\n >\n <c-box tag=\"span\" :id=\"titleId\" v-bind=\"labelAttrs\">\n <slot name=\"title\" />\n </c-box>\n </c-box>\n\n <c-box\n v-bind=\"messageAttrs\"\n v-if=\"$slots.default\"\n :data-variant=\"props.variant\"\n :id=\"bodyId\"\n >\n <slot />\n </c-box>\n </c-box>\n\n <c-close-button\n v-bind=\"closeButtonAttrs\"\n v-if=\"props.withCloseButton\"\n :aria-label=\"closeButtonLabel\"\n :icon-size=\"16\"\n :size=\"16\"\n :unstyled=\"props.unstyled\"\n variant=\"transparent\"\n @click=\"props.onClose\"\n ></c-close-button>\n </c-box>\n </c-box>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs } from 'vue'\nimport { useId } from '@cck-ui/hooks'\nimport { CBox, CStyleProp, useComponentProps, useStyles } from '../../core'\nimport classes from './alert.module.css'\nimport { AlertFactory, type AlertProps } from './alert.types'\nimport { varsResolver } from './alert.utils'\nimport CCloseButton from '../close-button'\n\ndefineOptions({\n name: 'CAlert',\n})\n\nconst slots = defineSlots<{\n default: any\n icon: any\n title: any\n}>()\n\nconst _root = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<AlertProps>()\n\nconst props = useComponentProps({\n component: 'CAlert',\n defaultProps: {},\n props: rawProps,\n})\n\nconst knownProps = [\n 'style',\n 'className',\n 'styles',\n 'classNames',\n 'unstyled',\n 'vars',\n 'radius',\n 'color',\n 'id',\n 'withCloseButton',\n 'onClose',\n 'closeButtonLabel',\n 'variant',\n 'autoContrast',\n 'role',\n 'attributes',\n]\n\nconst styleProps = computed(() => ({\n ...props.value,\n ...attrs,\n style: (attrs.style ?? props.value.style) as CStyleProp,\n}))\n\nconst getStyles = useStyles<AlertFactory>({\n name: 'Alert',\n props: styleProps,\n classes,\n className: () => props.value.className,\n style: () => props.value.style,\n classNames: props.value.classNames,\n styles: props.value.styles,\n unstyled: props.value.unstyled,\n attributes: props.value.attributes,\n vars: props.value.vars,\n varsResolver,\n})\n\nconst rootId = useId(props.value.id).value\nconst titleId = (slots.title && `${rootId}-title`) || undefined\nconst bodyId = `${rootId}-body`\n\nconst rootAttrs = computed(() => getStyles('root'))\nconst wrapperAttrs = computed(() => getStyles('wrapper'))\nconst iconAttrs = computed(() => getStyles('icon'))\nconst bodyAttrs = computed(() => getStyles('body'))\nconst titleAttrs = computed(() => getStyles('title'))\nconst labelAttrs = computed(() => getStyles('label'))\nconst messageAttrs = computed(() => getStyles('message'))\nconst closeButtonAttrs = computed(() => getStyles('close-button'))\n\nconst mergedRootAttrs = computed(() => {\n const others: Record<string, any> = {}\n const propsValue = props.value\n for (const key in propsValue) {\n if (!knownProps.includes(key)) {\n others[key] = propsValue[key as keyof typeof propsValue]\n }\n }\n const userMod = props.value.mod\n const mergedMod = [...(Array.isArray(userMod) ? userMod : [userMod])]\n return { ...others, mod: mergedMod, ...rootAttrs.value }\n})\n\ndefineExpose({\n root: computed(() => _root.value?.root ?? null),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;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BQ,OAAA,SAAA,eAAA,mBAnBO,OAAA,SAAS,CAAA,GAAA;4BASd,CANA,KAAA,OAAO,SAAA,UAAA,GAFf,YAQQ,OAAA,SARR,WAQQ,EAAA,KAAA,EAAA,GAPE,OAAA,YAAU,EAEjB,0BAAwB,OAAA,MAAM,mBAAmB,KAAA,EAAA,CAAA,GAAA;6BAI1C,CAFR,YAEQ,OAAA,SAFR,WAEQ;OAFD,KAAI;OAAQ,IAAI,OAAA;SAAiB,OAAA,UAAU,GAAA;8BAC3B,CAArB,WAAqB,KAAA,QAAA,OAAA,CAAA,CAAA;;;;6EAMjB,KAAA,OAAO,WAAA,UAAA,GAFf,YAOQ,OAAA,SAPR,WAOQ,EAAA,KAAA,EAAA,GANE,OAAA,cAAY;MAEnB,gBAAc,OAAA,MAAM;MACpB,IAAI,OAAA;;6BAEG,CAAR,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA;;;;;IAMJ,OAAA,MAAM,mBAAA,UAAA,GAFd,YASkB,OAAA,iBATlB,WASkB,EAAA,KAAA,EAAA,GARR,OAAA,kBAAgB;KAEvB,cAAY,OAAA;KACZ,aAAW;KACX,MAAM;KACN,UAAU,OAAA,MAAM;KACjB,SAAQ;KACP,SAAO,OAAA,MAAM"}
|
|
@@ -333,9 +333,9 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
333
333
|
name: "AspectRatio",
|
|
334
334
|
props: styleProps,
|
|
335
335
|
classes: aspect_ratio_module_default,
|
|
336
|
-
className: props.value.className,
|
|
336
|
+
className: () => props.value.className,
|
|
337
337
|
classNames: props.value.classNames,
|
|
338
|
-
style: props.value.style,
|
|
338
|
+
style: () => props.value.style,
|
|
339
339
|
styles: props.value.styles,
|
|
340
340
|
unstyled: props.value.unstyled,
|
|
341
341
|
attributes: props.value.attributes,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aspect-ratio.mjs","names":[],"sources":["../../../src/components/aspect-ratio/aspect-ratio.vue"],"sourcesContent":["<template>\n <c-box ref=\"_root\" v-bind=\"mergedAttrs\">\n <slot />\n </c-box>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs } from 'vue'\nimport { AspectRatioFactory, AspectRatioProps } from './aspect-ratio.types'\nimport { CBox, CStyleProp, useComponentProps, useStyles } from '../../core'\nimport classes from './aspect-ratio.module.css'\nimport { varsResolver } from './aspect-ratio.utils'\n\ndefineOptions({\n name: 'CAspectRatio',\n})\n\nconst _root = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<AspectRatioProps>()\n\nconst props = useComponentProps({\n component: 'CAspectRatio',\n defaultProps: {},\n props: rawProps,\n})\n\nconst knownProps = [\n 'classNames',\n 'className',\n 'style',\n 'styles',\n 'unstyled',\n 'vars',\n 'ratio',\n 'attributes',\n]\n\nconst styleProps = computed(() => ({\n ...props.value,\n ...attrs,\n style: (attrs.style ?? props.value.style) as CStyleProp,\n}))\n\nconst getStyles = useStyles<AspectRatioFactory>({\n name: 'AspectRatio',\n props: styleProps,\n classes,\n className: props.value.className,\n classNames: props.value.classNames,\n style: props.value.style,\n styles: props.value.styles,\n unstyled: props.value.unstyled,\n attributes: props.value.attributes,\n vars: props.value.vars,\n varsResolver,\n})\n\nconst rootAttrs = computed(() => getStyles('root'))\n\nconst mergedAttrs = computed(() => {\n const others: Record<string, any> = {}\n const propsValue = props.value\n Object.keys(propsValue).forEach((key) => {\n if (!knownProps.includes(key)) {\n others[key] = propsValue[key as keyof typeof propsValue]\n }\n })\n const userMod = props.value.mod\n const mergedMod = [...(Array.isArray(userMod) ? userMod : [userMod].filter(Boolean))]\n return { ...others, mod: mergedMod, ...rootAttrs.value }\n})\n\ndefineExpose({\n root: computed(() => _root.value?.root ?? null),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBA,MAAM,QAAQ,IAAsC,IAAI;EAExD,MAAM,QAAQ,SAAS;EAEvB,MAAM,WAAW;EAEjB,MAAM,QAAQ,kBAAkB;GAC9B,WAAW;GACX,cAAc,CAAC;GACf,OAAO;EACT,CAAC;EAED,MAAM,aAAa;GACjB;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;EAEA,MAAM,aAAa,gBAAgB;GACjC,GAAG,MAAM;GACT,GAAG;GACH,OAAQ,MAAM,SAAS,MAAM,MAAM;EACrC,EAAE;EAEF,MAAM,YAAY,UAA8B;GAC9C,MAAM;GACN,OAAO;GACP,SAAA;GACA,
|
|
1
|
+
{"version":3,"file":"aspect-ratio.mjs","names":[],"sources":["../../../src/components/aspect-ratio/aspect-ratio.vue"],"sourcesContent":["<template>\n <c-box ref=\"_root\" v-bind=\"mergedAttrs\">\n <slot />\n </c-box>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs } from 'vue'\nimport { AspectRatioFactory, AspectRatioProps } from './aspect-ratio.types'\nimport { CBox, CStyleProp, useComponentProps, useStyles } from '../../core'\nimport classes from './aspect-ratio.module.css'\nimport { varsResolver } from './aspect-ratio.utils'\n\ndefineOptions({\n name: 'CAspectRatio',\n})\n\nconst _root = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<AspectRatioProps>()\n\nconst props = useComponentProps({\n component: 'CAspectRatio',\n defaultProps: {},\n props: rawProps,\n})\n\nconst knownProps = [\n 'classNames',\n 'className',\n 'style',\n 'styles',\n 'unstyled',\n 'vars',\n 'ratio',\n 'attributes',\n]\n\nconst styleProps = computed(() => ({\n ...props.value,\n ...attrs,\n style: (attrs.style ?? props.value.style) as CStyleProp,\n}))\n\nconst getStyles = useStyles<AspectRatioFactory>({\n name: 'AspectRatio',\n props: styleProps,\n classes,\n className: () => props.value.className,\n classNames: props.value.classNames,\n style: () => props.value.style,\n styles: props.value.styles,\n unstyled: props.value.unstyled,\n attributes: props.value.attributes,\n vars: props.value.vars,\n varsResolver,\n})\n\nconst rootAttrs = computed(() => getStyles('root'))\n\nconst mergedAttrs = computed(() => {\n const others: Record<string, any> = {}\n const propsValue = props.value\n Object.keys(propsValue).forEach((key) => {\n if (!knownProps.includes(key)) {\n others[key] = propsValue[key as keyof typeof propsValue]\n }\n })\n const userMod = props.value.mod\n const mergedMod = [...(Array.isArray(userMod) ? userMod : [userMod].filter(Boolean))]\n return { ...others, mod: mergedMod, ...rootAttrs.value }\n})\n\ndefineExpose({\n root: computed(() => _root.value?.root ?? null),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBA,MAAM,QAAQ,IAAsC,IAAI;EAExD,MAAM,QAAQ,SAAS;EAEvB,MAAM,WAAW;EAEjB,MAAM,QAAQ,kBAAkB;GAC9B,WAAW;GACX,cAAc,CAAC;GACf,OAAO;EACT,CAAC;EAED,MAAM,aAAa;GACjB;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;EAEA,MAAM,aAA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