@cck-ui/core 0.28.0 → 0.30.0

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.
Files changed (40) hide show
  1. package/cjs/components/affix/affix.cjs +461 -0
  2. package/cjs/components/affix/affix.cjs.map +1 -0
  3. package/cjs/components/affix/affix.module.cjs +7 -0
  4. package/cjs/components/affix/affix.module.cjs.map +1 -0
  5. package/cjs/components/affix/affix.utils.cjs +14 -0
  6. package/cjs/components/affix/affix.utils.cjs.map +1 -0
  7. package/cjs/components/affix/index.cjs +14 -0
  8. package/cjs/components/affix/index.cjs.map +1 -0
  9. package/cjs/components/portal/portal.cjs +10 -3
  10. package/cjs/components/portal/portal.cjs.map +1 -1
  11. package/cjs/core/utils/get-default-z-index/get-default-z-index.cjs +16 -0
  12. package/cjs/core/utils/get-default-z-index/get-default-z-index.cjs.map +1 -0
  13. package/cjs/index.cjs +108 -103
  14. package/cjs/index.cjs.map +1 -1
  15. package/esm/components/affix/affix.mjs +459 -0
  16. package/esm/components/affix/affix.mjs.map +1 -0
  17. package/esm/components/affix/affix.module.mjs +7 -0
  18. package/esm/components/affix/affix.module.mjs.map +1 -0
  19. package/esm/components/affix/affix.utils.mjs +15 -0
  20. package/esm/components/affix/affix.utils.mjs.map +1 -0
  21. package/esm/components/affix/index.mjs +11 -0
  22. package/esm/components/affix/index.mjs.map +1 -0
  23. package/esm/components/portal/portal.mjs +11 -4
  24. package/esm/components/portal/portal.mjs.map +1 -1
  25. package/esm/core/utils/get-default-z-index/get-default-z-index.mjs +16 -0
  26. package/esm/core/utils/get-default-z-index/get-default-z-index.mjs.map +1 -0
  27. package/esm/index.mjs +5 -2
  28. package/esm/index.mjs.map +1 -1
  29. package/lib/components/affix/affix.types.d.ts +40 -0
  30. package/lib/components/affix/affix.utils.d.ts +6 -0
  31. package/lib/components/affix/index.d.ts +6 -0
  32. package/lib/components/index.d.ts +1 -0
  33. package/lib/components/portal/portal.types.d.ts +9 -0
  34. package/lib/core/utils/get-default-z-index/get-default-z-index.d.ts +9 -0
  35. package/lib/core/utils/index.d.ts +1 -0
  36. package/package.json +1 -1
  37. package/styles/affix.css +8 -0
  38. package/styles/affix.layer.css +9 -0
  39. package/styles.css +9 -0
  40. package/styles.layer.css +9 -0
@@ -0,0 +1,40 @@
1
+ import { Properties } from 'csstype';
2
+ import { BoxComponentProps, CSize, ElementProps, Factory, StylesApiProps } from '../../core';
3
+ import { PortalProps } from '../portal';
4
+ export type AffixStylesNames = 'root';
5
+ export type AffixCssVariables = {
6
+ root: '--affix-z-index' | '--affix-top' | '--affix-left' | '--affix-bottom' | '--affix-right';
7
+ };
8
+ export interface AffixPosition {
9
+ top?: CSize | (string & {}) | number;
10
+ left?: CSize | (string & {}) | number;
11
+ bottom?: CSize | (string & {}) | number;
12
+ right?: CSize | (string & {}) | number;
13
+ }
14
+ export interface AffixBaseProps {
15
+ /**
16
+ * Root element `z-index` property
17
+ * @default 200
18
+ */
19
+ zIndex?: Properties['zIndex'];
20
+ /**
21
+ * Determines whether the component is rendered within `Portal`
22
+ * @default true
23
+ */
24
+ withinPortal?: boolean;
25
+ /** Props passed down to the `Portal` component. Ignored when `withinPortal` is `false` */
26
+ portalProps?: PortalProps;
27
+ /**
28
+ * Affix position on screen
29
+ * @default { bottom: 0, right: 0 }
30
+ */
31
+ position?: AffixPosition;
32
+ }
33
+ export interface AffixProps extends BoxComponentProps, AffixBaseProps, StylesApiProps<AffixFactory>, ElementProps<'div'> {
34
+ }
35
+ export type AffixFactory = Factory<{
36
+ props: AffixProps;
37
+ ref: HTMLDivElement;
38
+ stylesNames: AffixStylesNames;
39
+ vars: AffixCssVariables;
40
+ }>;
@@ -0,0 +1,6 @@
1
+ export declare const varsResolver: import("../..").VarsResolver<{
2
+ props: import("./affix.types").AffixProps;
3
+ ref: HTMLDivElement;
4
+ stylesNames: import("./affix.types").AffixStylesNames;
5
+ vars: import("./affix.types").AffixCssVariables;
6
+ }>;
@@ -0,0 +1,6 @@
1
+ import { SFCWithInstallAndClasses } from '../../core';
2
+ import Affix from './affix.vue';
3
+ import classes from './affix.module.css';
4
+ export declare const CAffix: SFCWithInstallAndClasses<typeof Affix, typeof classes>;
5
+ export default CAffix;
6
+ export * from './affix.types';
@@ -1,4 +1,5 @@
1
1
  export * from './action-icon';
2
+ export * from './affix';
2
3
  export * from './alert';
3
4
  export * from './anchor';
4
5
  export * from './aspect-ratio';
@@ -8,6 +8,15 @@ export interface PortalProps {
8
8
  * Note: If selector doesn't match any element, portal will not render
9
9
  */
10
10
  target?: HTMLElement | string;
11
+ /**
12
+ * Determines whether children should be rendered inside Portal.
13
+ * When false, children are rendered as regular Vue children.
14
+ *
15
+ * Note: In test environment, Portal is always disabled regardless of this value.
16
+ *
17
+ * @default true
18
+ */
19
+ disabled?: boolean;
11
20
  /**
12
21
  * When true and target is not specified, all Portal instances share a single
13
22
  * container node appended to document.body. When false, each Portal creates
@@ -0,0 +1,9 @@
1
+ declare const elevations: {
2
+ readonly app: 100;
3
+ readonly modal: 200;
4
+ readonly popover: 300;
5
+ readonly overlay: 400;
6
+ readonly max: 9999;
7
+ };
8
+ export declare function getDefaultZIndex(level: keyof typeof elevations): 100 | 200 | 300 | 400 | 9999;
9
+ export {};
@@ -3,6 +3,7 @@ export { camelToKebabCase } from './camel-to-kebab-case/camel-to-kebab-case';
3
3
  export { filterProps } from './filter-props/filter-props';
4
4
  export { getBaseValue } from './get-base-value/get-base-value';
5
5
  export { getBreakpointValue } from './get-breakpoint-value/get-breakpoint-value';
6
+ export { getDefaultZIndex } from './get-default-z-index/get-default-z-index';
6
7
  export { getSize, getSpacing, getShadow, getRadius, getFontSize, getLineHeight, } from './get-size/get-size';
7
8
  export { getSortedBreakpoints } from './get-sorted-breakpoints/get-sorted-breakpoints';
8
9
  export { isNumberLike } from './is-number-like/is-number-like';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cck-ui/core",
3
- "version": "0.28.0",
3
+ "version": "0.30.0",
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,8 @@
1
+ .m_8b372bf {
2
+ position: fixed;
3
+ z-index: var(--affix-z-index);
4
+ inset-inline-start: var(--affix-left);
5
+ inset-inline-end: var(--affix-right);
6
+ top: var(--affix-top);
7
+ bottom: var(--affix-bottom);
8
+ }
@@ -0,0 +1,9 @@
1
+ @layer cck {.m_8b372bf {
2
+ position: fixed;
3
+ z-index: var(--affix-z-index);
4
+ inset-inline-start: var(--affix-left);
5
+ inset-inline-end: var(--affix-right);
6
+ top: var(--affix-top);
7
+ bottom: var(--affix-bottom);
8
+ }
9
+ }
package/styles.css CHANGED
@@ -1181,6 +1181,15 @@ fieldset:disabled .c-active:active {
1181
1181
  justify-content: center;
1182
1182
  }
1183
1183
 
1184
+ .m_8b372bf {
1185
+ position: fixed;
1186
+ z-index: var(--affix-z-index);
1187
+ inset-inline-start: var(--affix-left);
1188
+ inset-inline-end: var(--affix-right);
1189
+ top: var(--affix-top);
1190
+ bottom: var(--affix-bottom);
1191
+ }
1192
+
1184
1193
  .m_efb192b3 {
1185
1194
  --alert-radius: var(--c-radius-default);
1186
1195
  --alert-bg: var(--c-primary-color-light);
package/styles.layer.css CHANGED
@@ -1181,6 +1181,15 @@ fieldset:disabled .c-active:active {
1181
1181
  justify-content: center;
1182
1182
  }
1183
1183
 
1184
+ .m_8b372bf {
1185
+ position: fixed;
1186
+ z-index: var(--affix-z-index);
1187
+ inset-inline-start: var(--affix-left);
1188
+ inset-inline-end: var(--affix-right);
1189
+ top: var(--affix-top);
1190
+ bottom: var(--affix-bottom);
1191
+ }
1192
+
1184
1193
  .m_efb192b3 {
1185
1194
  --alert-radius: var(--c-radius-default);
1186
1195
  --alert-bg: var(--c-primary-color-light);