@cck-ui/core 0.12.2 → 0.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"box.mjs","names":[],"sources":["../../../src/core/box/box.vue"],"sourcesContent":["<template>\n <component ref=\"_root\" :is=\"rootTag\" v-bind=\"_props\">\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport cx from 'clsx'\nimport { computed, onBeforeUnmount, ref, watch } from 'vue'\nimport { isNumberLike } from '../utils'\nimport type { BoxComponentProps } from './box.types'\nimport { useCckTheme } from '../config-provider'\nimport { extractStyleProps, parseStyleProps, STYLE_PROPS_DATA } from './style-props'\nimport { getBoxStyle } from './get-box-style/get-box-style'\nimport {\n hashStyleProps,\n responsiveStyleManager,\n StylesMediaQuery,\n stylesToString,\n} from '../responsive-style-manager'\nimport { getBoxMod } from './get-box-mod/get-box-mod'\n\ndefineOptions({\n name: 'CBox',\n})\n\nconst _root = ref<HTMLElement | null>(null)\n\nconst props = withDefaults(\n defineProps<\n BoxComponentProps & {\n className: string\n renderRoot?: (props: Record<string, any>) => any\n tag?: any\n }\n >(),\n {\n tag: 'div',\n }\n)\n\nconst theme = useCckTheme()\n\nconst parsedStyleProps = computed(() => {\n const { styleProps, rest } = extractStyleProps(props)\n return {\n ...parseStyleProps({\n styleProps,\n theme: theme.value,\n data: STYLE_PROPS_DATA,\n }),\n rest,\n }\n})\n\nconst hasResponsive = computed(() => parsedStyleProps.value.hasResponsiveStyles)\nconst responsiveClassName = ref<string | null>(null)\nlet currentStyleKey: string | null = null\n\nfunction buildMediaQueriesFromObject(\n mediaObj: Record<string, any> | undefined\n): StylesMediaQuery[] {\n if (!mediaObj) {\n return []\n }\n return Object.entries(mediaObj).map(([query, styles]) => ({\n query,\n styles,\n }))\n}\n\nfunction updateResponsiveStyles() {\n if (currentStyleKey) {\n responsiveStyleManager.unregister(currentStyleKey)\n currentStyleKey = null\n responsiveClassName.value = null\n }\n\n if (!hasResponsive) {\n return\n }\n\n const mediaArray = buildMediaQueriesFromObject(parsedStyleProps.value.media)\n const hash = hashStyleProps(parsedStyleProps.value.styles, mediaArray)\n const className = hash\n\n const cssText = stylesToString({\n selector: className,\n styles: parsedStyleProps.value.styles,\n media: mediaArray,\n })\n\n const registeredKey = responsiveStyleManager.register(cssText, className)\n currentStyleKey = registeredKey\n responsiveClassName.value = className\n}\n\nupdateResponsiveStyles()\n\nwatch(\n () => [parsedStyleProps.value.styles, parsedStyleProps.value.media],\n () => {\n updateResponsiveStyles()\n },\n { deep: true, immediate: false }\n)\n\nonBeforeUnmount(() => {\n if (currentStyleKey) {\n responsiveStyleManager.unregister(currentStyleKey)\n }\n})\n\nconst _props = computed(() => {\n const { rest, inlineStyles } = parsedStyleProps.value\n\n const finalStyle = getBoxStyle({\n theme: theme.value,\n style: props.style,\n vars: props.__vars,\n styleProps: inlineStyles,\n })\n\n const finalClassName = cx(props.className, responsiveClassName.value, {\n 'c-light-hidden': props.lightHidden,\n 'c-dark-hidden': props.darkHidden,\n [`c-hidden-from-${props.hiddenFrom}`]: props.hiddenFrom,\n [`c-visible-from-${props.visibleFrom}`]: props.visibleFrom,\n })\n\n const {\n tag,\n style,\n __vars,\n className,\n variant,\n mod,\n size,\n hiddenFrom,\n visibleFrom,\n lightHidden,\n darkHidden,\n __size,\n ...restProps\n } = rest || {}\n\n return {\n ...restProps,\n style: finalStyle,\n className: finalClassName,\n 'data-variant': props.variant,\n 'data-size': isNumberLike(props.size) ? undefined : props.size || undefined,\n size: props.__size,\n ...getBoxMod(props.mod),\n }\n})\n\nconst rootTag = computed(() => {\n if (props.renderRoot) {\n return (p: Record<string, any>) => p.renderRoot(p)\n }\n\n return props.tag\n})\n\ndefineExpose({\n root: _root,\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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C5D;GACJ,uBAAuB;EACzB,GACA;GAAE,MAAM;GAAM,WAAW;EAAM,CACjC;EAEA,sBAAsB;GACpB,IAAI,iBACF,uBAAuB,WAAW,eAAe;EAErD,CAAC;EAED,MAAM,SAAS,eAAe;GAC5B,MAAM,EAAE,MAAM,iBAAiB,iBAAiB;GAEhD,MAAM,aAAa,YAAY;IAC7B,OAAO,MAAM;IACb,OAAO,MAAM;IACb,MAAM,MAAM;IACZ,YAAY;GACd,CAAC;GAED,MAAM,iBAAiB,GAAG,MAAM,WAAW,oBAAoB,OAAO;IACpE,kBAAkB,MAAM;IACxB,iBAAiB,MAAM;KACtB,iBAAiB,MAAM,eAAe,MAAM;KAC5C,kBAAkB,MAAM,gBAAgB,MAAM;GACjD,CAAC;GAED,MAAM,EACJ,KACA,OACA,QACA,WACA,SACA,KACA,MACA,YACA,aACA,aACA,YACA,QACA,GAAG,cACD,QAAQ,CAAC;GAEb,OAAO;IACL,GAAG;IACH,OAAO;IACP,WAAW;IACX,gBAAgB,MAAM;IACtB,aAAa,aAAa,MAAM,IAAI,IAAI,KAAA,IAAY,MAAM,QAAQ,KAAA;IAClE,MAAM,MAAM;IACZ,GAAG,UAAU,MAAM,GAAG;GACxB;EACF,CAAC;EAED,MAAM,UAAU,eAAe;GAC7B,IAAI,MAAM,YACR,QAAQ,MAA2B,EAAE,WAAW,CAAC;GAGnD,OAAO,MAAM;EACf,CAAC;EAED,SAAa,EACX,MAAM,MACR,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAtKC,YAEY,wBAFgB,OAAA,OAAO,GAAnC,WAEY,EAFD,KAAI,QAAO,GAAuB,OAAA,MAAM,GAAA;yBACzC,CAAR,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"box.mjs","names":[],"sources":["../../../src/core/box/box.vue"],"sourcesContent":["<template>\n <component ref=\"_root\" :is=\"rootTag\" v-bind=\"_props\">\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport cx from 'clsx'\nimport { computed, onBeforeUnmount, ref, watch } from 'vue'\nimport { isNumberLike } from '../utils'\nimport type { BoxComponentProps } from './box.types'\nimport { useCckTheme } from '../config-provider'\nimport { extractStyleProps, parseStyleProps, STYLE_PROPS_DATA } from './style-props'\nimport { getBoxStyle } from './get-box-style/get-box-style'\nimport {\n hashStyleProps,\n responsiveStyleManager,\n StylesMediaQuery,\n stylesToString,\n} from '../responsive-style-manager'\nimport { getBoxMod } from './get-box-mod/get-box-mod'\n\ndefineOptions({\n name: 'CBox',\n})\n\nconst _root = ref<HTMLElement | null>(null)\n\nconst props = withDefaults(\n defineProps<\n BoxComponentProps & {\n className: string\n renderRoot?: (props: Record<string, any>) => any\n tag?: any\n }\n >(),\n {\n tag: 'div',\n }\n)\n\nconst theme = useCckTheme()\n\nconst parsedStyleProps = computed(() => {\n const { styleProps, rest } = extractStyleProps(props)\n return {\n ...parseStyleProps({\n styleProps,\n theme: theme.value,\n data: STYLE_PROPS_DATA,\n }),\n rest,\n }\n})\n\nconst hasResponsive = computed(() => parsedStyleProps.value.hasResponsiveStyles)\nconst responsiveClassName = ref<string | null>(null)\nlet currentStyleKey: string | null = null\n\nfunction updateResponsiveStyles() {\n if (currentStyleKey) {\n responsiveStyleManager.unregister(currentStyleKey)\n currentStyleKey = null\n responsiveClassName.value = null\n }\n\n if (!hasResponsive) {\n return\n }\n\n const mediaArray = parsedStyleProps.value.media || []\n const hash = hashStyleProps(parsedStyleProps.value.styles, mediaArray)\n const className = hash\n\n const cssText = stylesToString({\n selector: className,\n styles: parsedStyleProps.value.styles,\n media: mediaArray,\n })\n\n const registeredKey = responsiveStyleManager.register(cssText, className)\n currentStyleKey = registeredKey\n responsiveClassName.value = className\n}\n\nupdateResponsiveStyles()\n\nwatch(\n () => [parsedStyleProps.value.styles, parsedStyleProps.value.media],\n () => {\n updateResponsiveStyles()\n },\n { deep: true, immediate: false }\n)\n\nonBeforeUnmount(() => {\n if (currentStyleKey) {\n responsiveStyleManager.unregister(currentStyleKey)\n }\n})\n\nconst _props = computed(() => {\n const { rest, inlineStyles } = parsedStyleProps.value\n\n const finalStyle = getBoxStyle({\n theme: theme.value,\n style: props.style,\n vars: props.__vars,\n styleProps: inlineStyles,\n })\n\n const finalClassName = cx(props.className, responsiveClassName.value, {\n 'c-light-hidden': props.lightHidden,\n 'c-dark-hidden': props.darkHidden,\n [`c-hidden-from-${props.hiddenFrom}`]: props.hiddenFrom,\n [`c-visible-from-${props.visibleFrom}`]: props.visibleFrom,\n })\n\n const {\n tag,\n style,\n __vars,\n className,\n variant,\n mod,\n size,\n hiddenFrom,\n visibleFrom,\n lightHidden,\n darkHidden,\n __size,\n ...restProps\n } = rest || {}\n\n return {\n ...restProps,\n style: finalStyle,\n className: finalClassName,\n 'data-variant': props.variant,\n 'data-size': isNumberLike(props.size) ? undefined : props.size || undefined,\n size: props.__size,\n ...getBoxMod(props.mod),\n }\n})\n\nconst rootTag = computed(() => {\n if (props.renderRoot) {\n return (p: Record<string, any>) => p.renderRoot(p)\n }\n\n return props.tag\n})\n\ndefineExpose({\n root: _root,\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0BA,MAAM,QAAQ,IAAwB,IAAI;EAE1C,MAAM,QAAQ;EAad,MAAM,QAAQ,YAAY;EAE1B,MAAM,mBAAmB,eAAe;GACtC,MAAM,EAAE,YAAY,SAAS,kBAAkB,KAAK;GACpD,OAAO;IACL,GAA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AAG;IACH,OAAO;IACP,WAAW;IACX,gBAAgB,MAAM;IACtB,aAAa,aAAa,MAAM,IAAI,IAAI,KAAA,IAAY,MAAM,QAAQ,KAAA;IAClE,MAAM,MAAM;IACZ,GAAG,UAAU,MAAM,GAAG;GACxB;EACF,CAAC;EAED,MAAM,UAAU,eAAe;GAC7B,IAAI,MAAM,YACR,QAAQ,MAA2B,EAAE,WAAW,CAAC;GAGnD,OAAO,MAAM;EACf,CAAC;EAED,SAAa,EACX,MAAM,MACR,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;qBA1JC,YAEY,wBAFgB,OAAA,OAAO,GAAnC,WAEY,EAFD,KAAI,QAAO,GAAuB,OAAA,MAAM,GAAA;yBACzC,CAAR,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA"}
package/esm/index.mjs CHANGED
@@ -61,6 +61,7 @@ import { CTransition } from "./components/transition/index.mjs";
61
61
  import { CButton, CButtonGroup, CButtonGroupSection } from "./components/button/index.mjs";
62
62
  import { CCenter } from "./components/center/index.mjs";
63
63
  import { CContainer } from "./components/container/index.mjs";
64
+ import { CFlex } from "./components/flex/index.mjs";
64
65
  import { CCol, CGrid } from "./components/grid/index.mjs";
65
66
  import { CGroup } from "./components/group/index.mjs";
66
67
  import { CSimpleGrid } from "./components/simple-grid/index.mjs";
@@ -82,6 +83,7 @@ const components = [
82
83
  CCloseButton,
83
84
  CCol,
84
85
  CContainer,
86
+ CFlex,
85
87
  CGrid,
86
88
  CGroup,
87
89
  CLoader,
@@ -102,6 +104,6 @@ const CckUI = { install(app) {
102
104
  });
103
105
  } };
104
106
  //#endregion
105
- export { CAlert, CAspectRatio, CBox, CButton, CButtonGroup, CButtonGroupSection, transitions as CCK_TRANSITIONS, CCenter, CCloseButton, CCol, CContainer, CDefaultLoaders, CGrid, CGroup, CLoader, CONFIG_KEY, CSimpleGrid, CSpace, CSplitter, CSplitterPane, CStack, CText, CTransition, CckConfigProvider, CckUI, CckUI as default, DEFAULT_THEME, FOCUS_CLASS_NAMES, STYLE_PROPS_DATA, THEME_KEY, UnstyledButton, alpha, camelToKebabCase, colorsTuple, createTheme, createVarsResolver, darken, deepMerge, defaultCssVariablesResolver, defaultVariantColorsResolver, em, extractStyleProps, filterProps, getBaseValue, getBreakpointValue, getCSSColorVariables, getComponentName, getFontSize, getGradient, getLineHeight, getPrimaryShade, getRadius, getShadow, getSize, getSortedBreakpoints, getSpacing, getThemeColor, getTransitionProps, hashStyleProps, isLightColor, isNumber, isNumberLike, isString, isStringNumber, isUndefined, isVirtualColor, keys, luminance, mergeThemeOverrides, normalizeNumberLikeStringProp, numberLikeStringToNumber, parseStyleProps, parseThemeColor, px, rem, resolveClassNames, resolveStyles, responsiveStyleManager, rgb, rgba, stylesToString, toRgba, useCckClassNamesPrefix, useCckColorScheme, useCckCssVariablesResolver, useCckEnv, useCckIsHeadless, useCckStyleNonce, useCckStylesTransform, useCckSxTransform, useCckTheme, useCckWithStaticClasses, useComponentProps, useConfigContext, useProviderColorScheme, useRandomClassName, useStyles, virtualColor, withClasses, withExtend, withInstall, withPropsDefaultSetter, withPropsFactory, withVarsResolver };
107
+ export { CAlert, CAspectRatio, CBox, CButton, CButtonGroup, CButtonGroupSection, transitions as CCK_TRANSITIONS, CCenter, CCloseButton, CCol, CContainer, CDefaultLoaders, CFlex, CGrid, CGroup, CLoader, CONFIG_KEY, CSimpleGrid, CSpace, CSplitter, CSplitterPane, CStack, CText, CTransition, CckConfigProvider, CckUI, CckUI as default, DEFAULT_THEME, FOCUS_CLASS_NAMES, STYLE_PROPS_DATA, THEME_KEY, UnstyledButton, alpha, camelToKebabCase, colorsTuple, createTheme, createVarsResolver, darken, deepMerge, defaultCssVariablesResolver, defaultVariantColorsResolver, em, extractStyleProps, filterProps, getBaseValue, getBreakpointValue, getCSSColorVariables, getComponentName, getFontSize, getGradient, getLineHeight, getPrimaryShade, getRadius, getShadow, getSize, getSortedBreakpoints, getSpacing, getThemeColor, getTransitionProps, hashStyleProps, isLightColor, isNumber, isNumberLike, isString, isStringNumber, isUndefined, isVirtualColor, keys, luminance, mergeThemeOverrides, normalizeNumberLikeStringProp, numberLikeStringToNumber, parseStyleProps, parseThemeColor, px, rem, resolveClassNames, resolveStyles, responsiveStyleManager, rgb, rgba, stylesToString, toRgba, useCckClassNamesPrefix, useCckColorScheme, useCckCssVariablesResolver, useCckEnv, useCckIsHeadless, useCckStyleNonce, useCckStylesTransform, useCckSxTransform, useCckTheme, useCckWithStaticClasses, useComponentProps, useConfigContext, useProviderColorScheme, useRandomClassName, useStyles, virtualColor, withClasses, withExtend, withInstall, withPropsDefaultSetter, withPropsFactory, withVarsResolver };
106
108
 
107
109
  //# sourceMappingURL=index.mjs.map
package/esm/index.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type { App, Plugin } from 'vue'\nimport {\n CAlert,\n CAspectRatio,\n CButton,\n CButtonGroup,\n CButtonGroupSection,\n CCenter,\n CCloseButton,\n CCol,\n CContainer,\n CGrid,\n CGroup,\n CLoader,\n CSimpleGrid,\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 CAlert,\n CAspectRatio,\n CButton,\n CButtonGroup,\n CButtonGroupSection,\n CCenter,\n CCloseButton,\n CCol,\n CContainer,\n CGrid,\n CGroup,\n CLoader,\n CSimpleGrid,\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAM,gBAAgB,OAAO,eAAe;AAE5C,MAAM,aAAa;CACjB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;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"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type { App, Plugin } from 'vue'\nimport {\n CAlert,\n CAspectRatio,\n CButton,\n CButtonGroup,\n CButtonGroupSection,\n CCenter,\n CCloseButton,\n CCol,\n CContainer,\n CFlex,\n CGrid,\n CGroup,\n CLoader,\n CSimpleGrid,\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 CAlert,\n CAspectRatio,\n CButton,\n CButtonGroup,\n CButtonGroupSection,\n CCenter,\n CCloseButton,\n CCol,\n CContainer,\n CFlex,\n CGrid,\n CGroup,\n CLoader,\n CSimpleGrid,\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAM,gBAAgB,OAAO,eAAe;AAE5C,MAAM,aAAa;CACjB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;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"}
@@ -0,0 +1,2 @@
1
+ import { SystemPropData } from '../../core';
2
+ export declare const FLEX_STYLE_PROPS_DATA: Record<string, SystemPropData>;
@@ -0,0 +1,39 @@
1
+ import { Properties } from 'csstype';
2
+ import { BoxProps, CSpacing, ElementProps, PolymorphicFactory, StyleProp, StylesApiProps } from '../../core';
3
+ export type FlexStylesNames = 'root';
4
+ export interface FlexProps extends BoxProps, StylesApiProps<FlexFactory>, /* @vue-ignore */ ElementProps<'div'> {
5
+ /**
6
+ * @description Gap between columns and rows, key of `theme.spacing` or any valid CSS
7
+ */
8
+ gap?: StyleProp<CSpacing>;
9
+ /**
10
+ * @description Row gap, overrides `gap` for vertical spacing
11
+ */
12
+ rowGap?: StyleProp<CSpacing>;
13
+ /**
14
+ * @description Column gap, overrides `gap` for horizontal spacing
15
+ */
16
+ columnGap?: StyleProp<CSpacing>;
17
+ /**
18
+ * @description Sets `align-items`
19
+ */
20
+ align?: StyleProp<Properties['alignItems']>;
21
+ /**
22
+ * @description Sets `justify-content`
23
+ */
24
+ justify?: StyleProp<Properties['justifyContent']>;
25
+ /**
26
+ * @description Sets `flex-wrap`
27
+ */
28
+ wrap?: StyleProp<Properties['flexWrap']>;
29
+ /**
30
+ * @description Sets `flex-direction`
31
+ */
32
+ direction?: StyleProp<Properties['flexDirection']>;
33
+ }
34
+ export type FlexFactory = PolymorphicFactory<{
35
+ props: FlexProps;
36
+ defaultRef: HTMLDivElement;
37
+ defaultComponent: 'div';
38
+ stylesNames: FlexStylesNames;
39
+ }>;
@@ -0,0 +1,6 @@
1
+ import { SFCWithInstallAndClasses } from '../../core';
2
+ import Flex from './flex.vue';
3
+ import classes from './flex.module.css';
4
+ export declare const CFlex: SFCWithInstallAndClasses<typeof Flex, typeof classes>;
5
+ export default CFlex;
6
+ export * from './flex.types';
@@ -4,6 +4,7 @@ export * from './button';
4
4
  export * from './center';
5
5
  export * from './close-button';
6
6
  export * from './container';
7
+ export * from './flex';
7
8
  export * from './grid';
8
9
  export * from './group';
9
10
  export * from './loader';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cck-ui/core",
3
- "version": "0.12.2",
3
+ "version": "0.13.1",
4
4
  "description": "Vue component library focused on usability, accessibility and developer experience",
5
5
  "homepage": "https://cck-ui.jackatlas.xyz",
6
6
  "license": "ISC",
@@ -0,0 +1,3 @@
1
+ .m_148db636 {
2
+ display: flex;
3
+ }
@@ -0,0 +1,4 @@
1
+ @layer cck {.m_148db636 {
2
+ display: flex;
3
+ }
4
+ }
package/styles.css CHANGED
@@ -1086,6 +1086,10 @@ fieldset:disabled .c-active:active {
1086
1086
  margin-inline: auto;
1087
1087
  }
1088
1088
 
1089
+ .m_148db636 {
1090
+ display: flex;
1091
+ }
1092
+
1089
1093
  .m_c031daba {
1090
1094
  container: c-grid / inline-size;
1091
1095
  }
package/styles.layer.css CHANGED
@@ -1086,6 +1086,10 @@ fieldset:disabled .c-active:active {
1086
1086
  margin-inline: auto;
1087
1087
  }
1088
1088
 
1089
+ .m_148db636 {
1090
+ display: flex;
1091
+ }
1092
+
1089
1093
  .m_c031daba {
1090
1094
  container: c-grid / inline-size;
1091
1095
  }