nuance-ui 0.2.9 → 0.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module.json +1 -1
- package/dist/runtime/components/action-icon/action-icon-section.d.vue.ts +11 -10
- package/dist/runtime/components/action-icon/action-icon-section.vue +17 -20
- package/dist/runtime/components/action-icon/action-icon-section.vue.d.ts +11 -10
- package/dist/runtime/components/action-icon/action-icon.d.vue.ts +17 -14
- package/dist/runtime/components/action-icon/action-icon.vue +18 -17
- package/dist/runtime/components/action-icon/action-icon.vue.d.ts +17 -14
- package/dist/runtime/components/alert.d.vue.ts +8 -6
- package/dist/runtime/components/alert.vue +15 -101
- package/dist/runtime/components/alert.vue.d.ts +8 -6
- package/dist/runtime/components/app-shell/app-shell-aside.vue +2 -28
- package/dist/runtime/components/app-shell/app-shell-footer.vue +2 -27
- package/dist/runtime/components/app-shell/app-shell-header.vue +2 -28
- package/dist/runtime/components/app-shell/app-shell-main.vue +2 -16
- package/dist/runtime/components/app-shell/app-shell-navbar.vue +2 -32
- package/dist/runtime/components/app-shell/app-shell-section.vue +2 -8
- package/dist/runtime/components/app-shell/app-shell.vue +20 -44
- package/dist/runtime/components/avatar/avatar-group.d.vue.ts +2 -2
- package/dist/runtime/components/avatar/avatar-group.vue +1 -1
- package/dist/runtime/components/avatar/avatar-group.vue.d.ts +2 -2
- package/dist/runtime/components/avatar/avatar.d.vue.ts +9 -5
- package/dist/runtime/components/avatar/avatar.vue +26 -26
- package/dist/runtime/components/avatar/avatar.vue.d.ts +9 -5
- package/dist/runtime/components/background-image.d.vue.ts +2 -2
- package/dist/runtime/components/background-image.vue +3 -19
- package/dist/runtime/components/background-image.vue.d.ts +2 -2
- package/dist/runtime/components/badge.d.vue.ts +9 -8
- package/dist/runtime/components/badge.vue +18 -154
- package/dist/runtime/components/badge.vue.d.ts +9 -8
- package/dist/runtime/components/breadcrumbs.d.vue.ts +4 -4
- package/dist/runtime/components/breadcrumbs.vue +2 -48
- package/dist/runtime/components/breadcrumbs.vue.d.ts +4 -4
- package/dist/runtime/components/button/button.d.vue.ts +21 -26
- package/dist/runtime/components/button/button.module.css +1 -1
- package/dist/runtime/components/button/button.vue +36 -42
- package/dist/runtime/components/button/button.vue.d.ts +21 -26
- package/dist/runtime/components/button/unstyled-button.vue +2 -21
- package/dist/runtime/components/calendar/calendar.d.vue.ts +2 -2
- package/dist/runtime/components/calendar/calendar.vue +3 -10
- package/dist/runtime/components/calendar/calendar.vue.d.ts +2 -2
- package/dist/runtime/components/calendar/ui/core/calendar-cell.d.vue.ts +2 -2
- package/dist/runtime/components/calendar/ui/core/calendar-cell.vue +3 -114
- package/dist/runtime/components/calendar/ui/core/calendar-cell.vue.d.ts +2 -2
- package/dist/runtime/components/calendar/ui/core/calendar-header.vue +2 -67
- package/dist/runtime/components/calendar/ui/levels/calendar-decade.d.vue.ts +2 -2
- package/dist/runtime/components/calendar/ui/levels/calendar-decade.vue +3 -25
- package/dist/runtime/components/calendar/ui/levels/calendar-decade.vue.d.ts +2 -2
- package/dist/runtime/components/calendar/ui/levels/calendar-month.d.vue.ts +2 -2
- package/dist/runtime/components/calendar/ui/levels/calendar-month.vue +9 -34
- package/dist/runtime/components/calendar/ui/levels/calendar-month.vue.d.ts +2 -2
- package/dist/runtime/components/calendar/ui/levels/calendar-year.d.vue.ts +2 -2
- package/dist/runtime/components/calendar/ui/levels/calendar-year.vue +3 -25
- package/dist/runtime/components/calendar/ui/levels/calendar-year.vue.d.ts +2 -2
- package/dist/runtime/components/checkbox/checkbox-card.vue +2 -28
- package/dist/runtime/components/checkbox/checkbox-group.vue +3 -3
- package/dist/runtime/components/checkbox/checkbox-indicator.d.vue.ts +5 -4
- package/dist/runtime/components/checkbox/checkbox-indicator.vue +15 -123
- package/dist/runtime/components/checkbox/checkbox-indicator.vue.d.ts +5 -4
- package/dist/runtime/components/checkbox/checkbox.d.vue.ts +5 -7
- package/dist/runtime/components/checkbox/checkbox.vue +30 -136
- package/dist/runtime/components/checkbox/checkbox.vue.d.ts +5 -7
- package/dist/runtime/components/chip/chip.d.vue.ts +3 -2
- package/dist/runtime/components/chip/chip.vue +29 -212
- package/dist/runtime/components/chip/chip.vue.d.ts +3 -2
- package/dist/runtime/components/combobox/combobox-dropdown.vue +2 -4
- package/dist/runtime/components/container.d.vue.ts +2 -2
- package/dist/runtime/components/container.vue +1 -1
- package/dist/runtime/components/container.vue.d.ts +2 -2
- package/dist/runtime/components/date-time-picker.vue +6 -10
- package/dist/runtime/components/dialog/ui/dialog-close-button.vue +11 -7
- package/dist/runtime/components/dialog/ui/dialog-root.d.vue.ts +11 -9
- package/dist/runtime/components/dialog/ui/dialog-root.vue +5 -5
- package/dist/runtime/components/dialog/ui/dialog-root.vue.d.ts +11 -9
- package/dist/runtime/components/dialog/ui/dialog-title.vue +2 -2
- package/dist/runtime/components/drawer/drawer-close-button.vue +6 -6
- package/dist/runtime/components/drawer/drawer-root.vue +4 -4
- package/dist/runtime/components/drawer/drawer-title.vue +2 -2
- package/dist/runtime/components/files/file-upload-button.vue +8 -7
- package/dist/runtime/components/files/file-upload-icon.vue +5 -5
- package/dist/runtime/components/input/date-picker.vue +6 -10
- package/dist/runtime/components/input/email-input.vue +4 -4
- package/dist/runtime/components/input/lib/input-wrapper.context.d.ts +5 -5
- package/dist/runtime/components/input/number-input.vue +6 -84
- package/dist/runtime/components/input/password-input.vue +4 -4
- package/dist/runtime/components/input/text-input.vue +4 -4
- package/dist/runtime/components/input/ui/button-input.vue +6 -25
- package/dist/runtime/components/input/ui/input-base.vue +6 -265
- package/dist/runtime/components/input/ui/input-inline.d.vue.ts +2 -2
- package/dist/runtime/components/input/ui/input-inline.vue +3 -82
- package/dist/runtime/components/input/ui/input-inline.vue.d.ts +2 -2
- package/dist/runtime/components/input/ui/input-label.d.vue.ts +2 -2
- package/dist/runtime/components/input/ui/input-label.vue +1 -1
- package/dist/runtime/components/input/ui/input-label.vue.d.ts +2 -2
- package/dist/runtime/components/input/ui/input-wrapper.d.vue.ts +5 -1
- package/dist/runtime/components/input/ui/input-wrapper.vue +13 -65
- package/dist/runtime/components/input/ui/input-wrapper.vue.d.ts +5 -1
- package/dist/runtime/components/input/ui/spin-input.vue +2 -53
- package/dist/runtime/components/link/link-button.vue +9 -8
- package/dist/runtime/components/link/link.vue +2 -2
- package/dist/runtime/components/loader/loader.d.vue.ts +7 -7
- package/dist/runtime/components/loader/loader.vue +8 -7
- package/dist/runtime/components/loader/loader.vue.d.ts +7 -7
- package/dist/runtime/components/modal/modal-close-button.vue +6 -6
- package/dist/runtime/components/modal/modal-root.vue +4 -4
- package/dist/runtime/components/modal/modal-title.vue +2 -2
- package/dist/runtime/components/nav-link/nav-icon-link.vue +4 -4
- package/dist/runtime/components/nav-link/nav-link.d.vue.ts +6 -5
- package/dist/runtime/components/nav-link/nav-link.vue +30 -113
- package/dist/runtime/components/nav-link/nav-link.vue.d.ts +6 -5
- package/dist/runtime/components/paper.vue +2 -31
- package/dist/runtime/components/popover/popover-dropdown.vue +2 -54
- package/dist/runtime/components/progress/progress-root.d.vue.ts +3 -3
- package/dist/runtime/components/progress/progress-root.vue +2 -2
- package/dist/runtime/components/progress/progress-root.vue.d.ts +3 -3
- package/dist/runtime/components/progress/progress-section.d.vue.ts +3 -0
- package/dist/runtime/components/progress/progress-section.vue +8 -6
- package/dist/runtime/components/progress/progress-section.vue.d.ts +3 -0
- package/dist/runtime/components/progress/progress.vue +2 -2
- package/dist/runtime/components/select.vue +6 -10
- package/dist/runtime/components/switch/switch-group.vue +3 -3
- package/dist/runtime/components/switch/switch.d.vue.ts +3 -0
- package/dist/runtime/components/switch/switch.vue +15 -205
- package/dist/runtime/components/switch/switch.vue.d.ts +3 -0
- package/dist/runtime/components/table/types.d.ts +4 -3
- package/dist/runtime/components/table/ui/table-sortable-header.vue +9 -8
- package/dist/runtime/components/table/ui/table.vue +9 -174
- package/dist/runtime/components/tabs/tabs-root.d.vue.ts +14 -16
- package/dist/runtime/components/tabs/tabs-root.vue +14 -12
- package/dist/runtime/components/tabs/tabs-root.vue.d.ts +14 -16
- package/dist/runtime/components/text.d.vue.ts +10 -9
- package/dist/runtime/components/text.vue +16 -77
- package/dist/runtime/components/text.vue.d.ts +10 -9
- package/dist/runtime/components/textarea.vue +4 -4
- package/dist/runtime/components/time-picker/time-picker.vue +6 -132
- package/dist/runtime/components/title.vue +4 -8
- package/dist/runtime/components/tree/_ui/tree-item.vue +2 -62
- package/dist/runtime/components/tree/_ui/tree-root.d.vue.ts +7 -6
- package/dist/runtime/components/tree/_ui/tree-root.vue +13 -19
- package/dist/runtime/components/tree/_ui/tree-root.vue.d.ts +7 -6
- package/dist/runtime/components/tree/tree.vue +5 -5
- package/dist/runtime/composables/index.d.ts +1 -1
- package/dist/runtime/composables/index.js +1 -1
- package/dist/runtime/composables/use-vars-resolver.d.ts +4 -0
- package/dist/runtime/composables/use-vars-resolver.js +6 -0
- package/dist/runtime/types/index.d.ts +2 -2
- package/dist/runtime/types/styling.d.ts +6 -0
- package/dist/runtime/types/styling.js +0 -0
- package/dist/runtime/types/theme.d.ts +10 -15
- package/dist/runtime/utils/color/parse-theme-color.d.ts +2 -2
- package/dist/runtime/utils/style/create-variant-color-resolver.d.ts +2 -2
- package/package.json +2 -2
- package/dist/runtime/composables/use-style-resolver.d.ts +0 -6
- package/dist/runtime/composables/use-style-resolver.js +0 -5
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import type { NuanceColor, NuanceGradient, NuanceRadius, NuanceSize } from '@nui/types';
|
|
1
|
+
import type { AnyString, NuanceColor, NuanceGradient, NuanceRadius, NuanceSize } from '@nui/types';
|
|
2
2
|
import type { BoxProps } from './box.vue.js';
|
|
3
|
+
export type BadgeVariant = 'filled' | 'light' | 'outline' | 'dot' | 'default' | 'gradient';
|
|
4
|
+
export interface BadgeVars {
|
|
5
|
+
root: '--badge-height' | '--badge-padding-x' | '--badge-fz' | '--badge-radius' | '--badge-bg' | '--badge-color' | '--badge-bd' | '--badge-dot-color';
|
|
6
|
+
}
|
|
3
7
|
export interface BadgeProps extends BoxProps {
|
|
4
|
-
/**
|
|
5
|
-
* Visual variant
|
|
6
|
-
* @default `'filled'`
|
|
7
|
-
*/
|
|
8
|
-
variant?: 'filled' | 'light' | 'outline' | 'dot' | 'default' | 'gradient';
|
|
9
8
|
/**
|
|
10
9
|
* Component size
|
|
11
10
|
* @default `'md'`
|
|
12
11
|
*/
|
|
13
|
-
size?: NuanceSize |
|
|
12
|
+
size?: NuanceSize | AnyString;
|
|
14
13
|
/** Makes the badge width equal to its height and removes horizontal padding */
|
|
15
14
|
circle?: boolean;
|
|
16
15
|
/**
|
|
@@ -19,7 +18,7 @@ export interface BadgeProps extends BoxProps {
|
|
|
19
18
|
*/
|
|
20
19
|
radius?: NuanceRadius;
|
|
21
20
|
/** Color from theme */
|
|
22
|
-
color?: NuanceColor |
|
|
21
|
+
color?: NuanceColor | AnyString;
|
|
23
22
|
/** Gradient configuration (used with `variant="gradient"`) */
|
|
24
23
|
gradient?: NuanceGradient;
|
|
25
24
|
/**
|
|
@@ -29,6 +28,8 @@ export interface BadgeProps extends BoxProps {
|
|
|
29
28
|
fullWidth?: boolean;
|
|
30
29
|
/** Icon displayed before the label */
|
|
31
30
|
icon?: string;
|
|
31
|
+
/** Visual variant */
|
|
32
|
+
variant?: BadgeVariant;
|
|
32
33
|
}
|
|
33
34
|
declare var __VLS_8: {}, __VLS_15: {}, __VLS_17: {};
|
|
34
35
|
type __VLS_Slots = {} & {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { NuanceSpacing } from '@nui/types';
|
|
1
|
+
import type { NuanceColor, NuanceSpacing } from '@nui/types';
|
|
2
2
|
import type { MaybeRef } from 'vue';
|
|
3
3
|
import type { BoxProps } from './box.vue.js';
|
|
4
|
-
import type { ButtonProps } from './button/button.vue.js';
|
|
4
|
+
import type { ButtonProps, ButtonVariant } from './button/button.vue.js';
|
|
5
5
|
import type { LinkProps } from './link/index.js';
|
|
6
6
|
export interface BreadcrumbsItem extends Omit<LinkProps, 'mod'> {
|
|
7
7
|
/** Marks item as active */
|
|
@@ -29,12 +29,12 @@ export interface BreadcrumbsProps extends BoxProps {
|
|
|
29
29
|
* Visual variant
|
|
30
30
|
* @default `'subtle'`
|
|
31
31
|
*/
|
|
32
|
-
variant?:
|
|
32
|
+
variant?: ButtonVariant;
|
|
33
33
|
/**
|
|
34
34
|
* Color from theme
|
|
35
35
|
* @default `'primary'`
|
|
36
36
|
*/
|
|
37
|
-
color?:
|
|
37
|
+
color?: NuanceColor;
|
|
38
38
|
/**
|
|
39
39
|
* Component size
|
|
40
40
|
* @default `'compact-sm'`
|
|
@@ -66,52 +66,6 @@ const breadcrumbs = computed(() => unref(items) ?? []);
|
|
|
66
66
|
</Box>
|
|
67
67
|
</template>
|
|
68
68
|
|
|
69
|
-
<style module
|
|
70
|
-
.root {
|
|
71
|
-
--bc-spacing: var(--spacing-xs);
|
|
72
|
-
|
|
73
|
-
display: flex;
|
|
74
|
-
flex-wrap: wrap;
|
|
75
|
-
gap: var(--bc-spacing);
|
|
76
|
-
align-items: center;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.breadcrumb {
|
|
80
|
-
line-height: 1;
|
|
81
|
-
|
|
82
|
-
color: var(--color-text);
|
|
83
|
-
white-space: nowrap;
|
|
84
|
-
-webkit-tap-highlight-color: transparent;
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.item {
|
|
89
|
-
display: flex;
|
|
90
|
-
gap: .25rem;
|
|
91
|
-
align-items: center;
|
|
92
|
-
|
|
93
|
-
font-weight: 600;
|
|
94
|
-
text-transform: capitalize;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.icon {
|
|
98
|
-
width: 1.2em;
|
|
99
|
-
height: 1.2em;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.separator {
|
|
103
|
-
display: flex;
|
|
104
|
-
align-items: center;
|
|
105
|
-
justify-content: center;
|
|
106
|
-
|
|
107
|
-
line-height: 1;
|
|
108
|
-
|
|
109
|
-
@mixin where-light {
|
|
110
|
-
color: var(--color-gray-7);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
@mixin where-dark {
|
|
114
|
-
color: var(--color-dark-2);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
69
|
+
<style module>
|
|
70
|
+
.root{--bc-spacing:var(--spacing-xs);align-items:center;display:flex;flex-wrap:wrap;gap:var(--bc-spacing)}.breadcrumb{color:var(--color-text);line-height:1;white-space:nowrap;-webkit-tap-highlight-color:transparent}.item{align-items:center;display:flex;font-weight:600;gap:.25rem;text-transform:capitalize}.icon{height:1.2em;width:1.2em}.separator{align-items:center;display:flex;justify-content:center;line-height:1;@mixin where-light{color:var(--color-gray-7)}@mixin where-dark{color:var(--color-dark-2)}}
|
|
117
71
|
</style>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { NuanceSpacing } from '@nui/types';
|
|
1
|
+
import type { NuanceColor, NuanceSpacing } from '@nui/types';
|
|
2
2
|
import type { MaybeRef } from 'vue';
|
|
3
3
|
import type { BoxProps } from './box.vue.js';
|
|
4
|
-
import type { ButtonProps } from './button/button.vue.js';
|
|
4
|
+
import type { ButtonProps, ButtonVariant } from './button/button.vue.js';
|
|
5
5
|
import type { LinkProps } from './link/index.js';
|
|
6
6
|
export interface BreadcrumbsItem extends Omit<LinkProps, 'mod'> {
|
|
7
7
|
/** Marks item as active */
|
|
@@ -29,12 +29,12 @@ export interface BreadcrumbsProps extends BoxProps {
|
|
|
29
29
|
* Visual variant
|
|
30
30
|
* @default `'subtle'`
|
|
31
31
|
*/
|
|
32
|
-
variant?:
|
|
32
|
+
variant?: ButtonVariant;
|
|
33
33
|
/**
|
|
34
34
|
* Color from theme
|
|
35
35
|
* @default `'primary'`
|
|
36
36
|
*/
|
|
37
|
-
color?:
|
|
37
|
+
color?: NuanceColor;
|
|
38
38
|
/**
|
|
39
39
|
* Component size
|
|
40
40
|
* @default `'compact-sm'`
|
|
@@ -1,42 +1,37 @@
|
|
|
1
|
-
import type { Classes, NuanceColor, NuanceGradient, NuanceRadius, NuanceSize } from '@nui/types';
|
|
2
|
-
import type { HTMLAttributes } from 'vue';
|
|
1
|
+
import type { AnyString, Classes, NuanceColor, NuanceGradient, NuanceRadius, NuanceSize, NuanceSpacing } from '@nui/types';
|
|
2
|
+
import type { CSSProperties, HTMLAttributes } from 'vue';
|
|
3
3
|
import type { BoxProps } from '../box.vue.js';
|
|
4
|
+
export type ButtonClasses = 'root' | 'inner' | 'label' | 'section';
|
|
5
|
+
export type ButtonVariant = 'filled' | 'light' | 'outline' | 'subtle' | 'default' | 'gradient' | 'gradient-outline';
|
|
4
6
|
export interface ButtonProps extends BoxProps {
|
|
7
|
+
/** Color from theme */
|
|
8
|
+
color?: NuanceColor;
|
|
5
9
|
/** Component size */
|
|
6
10
|
size?: NuanceSize | `compact-${NuanceSize}`;
|
|
7
11
|
/** Spacing token */
|
|
8
|
-
spacing?:
|
|
9
|
-
/**
|
|
10
|
-
* Visual variant
|
|
11
|
-
* @default `'default'`
|
|
12
|
-
*/
|
|
13
|
-
variant?: 'filled' | 'light' | 'outline' | 'subtle' | 'default' | 'gradient' | 'gradient-outline';
|
|
12
|
+
spacing?: NuanceSpacing | AnyString;
|
|
14
13
|
/** Gradient configuration (used with `variant="gradient"`) */
|
|
15
14
|
gradient?: NuanceGradient;
|
|
15
|
+
/** Border radius */
|
|
16
|
+
radius?: NuanceRadius | AnyString;
|
|
17
|
+
/** Sets `justify-content` of `inner` element @default 'center' */
|
|
18
|
+
justify?: CSSProperties['justify-content'];
|
|
19
|
+
/** `pointer-events` value for the left section @default `'none'` */
|
|
20
|
+
leftSectionPE?: CSSProperties['pointer-events'];
|
|
21
|
+
/** `pointer-events` value for the right section @default `'all'` */
|
|
22
|
+
rightSectionPE?: CSSProperties['pointer-events'];
|
|
16
23
|
/** Loading state */
|
|
17
24
|
loading?: boolean;
|
|
18
|
-
/** Color from theme */
|
|
19
|
-
color?: NuanceColor;
|
|
20
|
-
/** Border radius */
|
|
21
|
-
radius?: NuanceRadius;
|
|
22
|
-
/** Styles API */
|
|
23
|
-
classes?: Classes<'root' | 'inner' | 'label' | 'section'>;
|
|
24
|
-
/**
|
|
25
|
-
* `pointer-events` value for the left section
|
|
26
|
-
* @default `'none'`
|
|
27
|
-
*/
|
|
28
|
-
leftSectionPE?: CSSStyleDeclaration['pointerEvents'];
|
|
29
|
-
/** Extra attributes forwarded to the left section element */
|
|
30
|
-
leftSectionProps?: HTMLAttributes;
|
|
31
25
|
/** Icon displayed before the label */
|
|
32
26
|
icon?: string;
|
|
33
|
-
/**
|
|
34
|
-
|
|
35
|
-
* @default `'all'`
|
|
36
|
-
*/
|
|
37
|
-
rightSectionPE?: CSSStyleDeclaration['pointerEvents'];
|
|
27
|
+
/** Extra attributes forwarded to the left section element */
|
|
28
|
+
leftSectionProps?: HTMLAttributes;
|
|
38
29
|
/** Extra attributes forwarded to the right section element */
|
|
39
30
|
rightSectionProps?: HTMLAttributes;
|
|
31
|
+
/** Visual variant */
|
|
32
|
+
variant?: ButtonVariant;
|
|
33
|
+
/** Styles API */
|
|
34
|
+
classes?: Classes<ButtonClasses>;
|
|
40
35
|
}
|
|
41
36
|
declare var __VLS_19: {}, __VLS_26: {}, __VLS_28: {};
|
|
42
37
|
type __VLS_Slots = {} & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.root{--button-height-xs:rem(30px);--button-height-sm:rem(36px);--button-height-md:rem(42px);--button-height-lg:rem(50px);--button-height-xl:rem(60px);--button-height-compact-xs:rem(22px);--button-height-compact-sm:rem(26px);--button-height-compact-md:rem(30px);--button-height-compact-lg:rem(34px);--button-height-compact-xl:rem(40px);--button-padding-x-xs:rem(14px);--button-padding-x-sm:rem(18px);--button-padding-x-md:rem(22px);--button-padding-x-lg:rem(26px);--button-padding-x-xl:rem(32px);--button-padding-x-compact-xs:rem(7px);--button-padding-x-compact-sm:rem(8px);--button-padding-x-compact-md:rem(10px);--button-padding-x-compact-lg:rem(12px);--button-padding-x-compact-xl:rem(14px);--button-height:var(--button-height-sm);--button-padding-x:var(--button-padding-x-sm);--button-color:var(--color-white);--button-fz:var(--font-size-sm);--button-bg:var(--color-primary-filled);--button-radius:var(--radius-default);--button-hover:var(--color-primary-filled-hover);--button-spacing:0;--button-section-size:calc(var(--button-height) - 0.25rem);background:var(--button-bg);border:var(--button-bd,rem(1px) solid transparent);border-radius:var(--button-radius);color:var(--button-color,var(--color-white));cursor:pointer;display:inline-block;font-size:var(--button-fz);font-weight:600;height:var(--button-height,var(--button-height-sm));line-height:1;overflow:hidden;padding-inline:var(--button-padding-x,var(--button-padding-x-sm));position:relative;text-align:center;transition:background-color .2s ease-in,color .2s ease-in;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle;width:auto}.root:where([data-with-left-section]){padding-inline-start:0}.root:where([data-with-right-section]){padding-inline-end:0}.root:where([data-variant=gradient-outline]){background-clip:padding-box,border-box;background-origin:border-box}.root:where(:disabled:not([data-loading])){background:var(--color-disabled);border:1px solid transparent;color:var(--color-disabled);cursor:not-allowed;transform:none}.root:before{border-radius:var(--button-radius,var(--radius-default));content:"";filter:blur(12px);inset:-1px;opacity:0;pointer-events:none;position:absolute;transform:translateY(-100%);transition:transform .15s ease,opacity .1s ease;@mixin where-light{background:var(--color-gray-1);color:var(--color-gray-5)}@mixin where-dark{background:var(--color-dark-6);color:var(--color-dark-3)}}.root:where([data-loading]){cursor:not-allowed;transform:none}.root:where([data-loading]):before{opacity:1;transform:translateY(0)}.root:where([data-loading]) .inner{opacity:0;transform:translateY(100%)}.root:hover:where(:not([data-loading],:disabled)){background:var(--button-hover);color:var(--button-color)}.root:hover:where(:not([data-loading],:disabled)):where([data-variant=gradient-outline]){color:#fff}.inner{gap:var(--button-spacing);justify-content:center;overflow:visible;transition:transform .15s ease,opacity .1s ease;width:100%}.inner,.label{align-items:center;display:flex;height:100%}.label{flex:1;opacity:1;overflow:hidden;white-space:nowrap}.label:where([data-loading]){opacity:.2}.section{--section-pointer-events:none;align-items:center;display:flex;height:100%;justify-content:center;pointer-events:var(--section-pointer-events);width:var(--button-section-size)}.loader{left:calc(50% - var(--loader-size)/2);position:absolute;top:calc(50% - var(--loader-size)/2)}.group{--group-border-width:1px;display:flex}.group>:where(*):focus{position:relative;z-index:1}.group[data-orientation=horizontal]{flex-direction:row}.group[data-orientation=horizontal]>:where(*):not(:only-child):first-child{border-end-end-radius:0;border-inline-end-width:calc(var(--group-border-width)/2);border-start-end-radius:0}.group[data-orientation=horizontal]>:where(*):not(:only-child):last-child{border-end-start-radius:0;border-inline-start-width:calc(var(--group-border-width)/2);border-start-start-radius:0}.group[data-orientation=horizontal]>:where(*):not(:only-child):not(:first-child):not(:last-child){border-inline-width:calc(var(--group-border-width)/2);border-radius:0}.group[data-orientation=vertical]{flex-direction:column}.group[data-orientation=vertical]>:where(*):not(:only-child):first-child{border-bottom-width:calc(var(--group-border-width)/2);border-end-end-radius:0;border-end-start-radius:0}.group[data-orientation=vertical]>:where(*):not(:only-child):last-child{border-start-end-radius:0;border-start-start-radius:0;border-top-width:calc(var(--group-border-width)/2)}.group[data-orientation=vertical]>:where(*):not(:only-child):not(:first-child):not(:last-child){border-bottom-width:calc(var(--group-border-width)/2);border-radius:0;border-top-width:calc(var(--group-border-width)/2)}
|
|
1
|
+
.root{--button-height-xs:rem(30px);--button-height-sm:rem(36px);--button-height-md:rem(42px);--button-height-lg:rem(50px);--button-height-xl:rem(60px);--button-height-compact-xs:rem(22px);--button-height-compact-sm:rem(26px);--button-height-compact-md:rem(30px);--button-height-compact-lg:rem(34px);--button-height-compact-xl:rem(40px);--button-padding-x-xs:rem(14px);--button-padding-x-sm:rem(18px);--button-padding-x-md:rem(22px);--button-padding-x-lg:rem(26px);--button-padding-x-xl:rem(32px);--button-padding-x-compact-xs:rem(7px);--button-padding-x-compact-sm:rem(8px);--button-padding-x-compact-md:rem(10px);--button-padding-x-compact-lg:rem(12px);--button-padding-x-compact-xl:rem(14px);--button-height:var(--button-height-sm);--button-padding-x:var(--button-padding-x-sm);--button-color:var(--color-white);--button-fz:var(--font-size-sm);--button-bg:var(--color-primary-filled);--button-radius:var(--radius-default);--button-hover:var(--color-primary-filled-hover);--button-spacing:0;--button-justify:center;--button-section-size:calc(var(--button-height) - 0.25rem);background:var(--button-bg);border:var(--button-bd,rem(1px) solid transparent);border-radius:var(--button-radius);color:var(--button-color,var(--color-white));cursor:pointer;display:inline-block;font-size:var(--button-fz);font-weight:600;height:var(--button-height,var(--button-height-sm));line-height:1;overflow:hidden;padding-inline:var(--button-padding-x,var(--button-padding-x-sm));position:relative;text-align:center;transition:background-color .2s ease-in,color .2s ease-in;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle;width:auto}.root:where([data-with-left-section]){padding-inline-start:0}.root:where([data-with-right-section]){padding-inline-end:0}.root:where([data-variant=gradient-outline]){background-clip:padding-box,border-box;background-origin:border-box}.root:where(:disabled:not([data-loading])){background:var(--color-disabled);border:1px solid transparent;color:var(--color-disabled);cursor:not-allowed;transform:none}.root:before{border-radius:var(--button-radius,var(--radius-default));content:"";filter:blur(12px);inset:-1px;opacity:0;pointer-events:none;position:absolute;transform:translateY(-100%);transition:transform .15s ease,opacity .1s ease;@mixin where-light{background:var(--color-gray-1);color:var(--color-gray-5)}@mixin where-dark{background:var(--color-dark-6);color:var(--color-dark-3)}}.root:where([data-loading]){cursor:not-allowed;transform:none}.root:where([data-loading]):before{opacity:1;transform:translateY(0)}.root:where([data-loading]) .inner{opacity:0;transform:translateY(100%)}.root:hover:where(:not([data-loading],:disabled)){background:var(--button-hover);color:var(--button-color)}.root:hover:where(:not([data-loading],:disabled)):where([data-variant=gradient-outline]){color:#fff}.inner{gap:var(--button-spacing);justify-content:center;overflow:visible;transition:transform .15s ease,opacity .1s ease;width:100%}.inner,.label{align-items:center;display:flex;height:100%}.label{flex:1;justify-content:var(--button-justify);opacity:1;overflow:hidden;white-space:nowrap}.label:where([data-loading]){opacity:.2}.section{--section-pointer-events:none;align-items:center;display:flex;height:100%;justify-content:center;pointer-events:var(--section-pointer-events);width:var(--button-section-size)}.loader{left:calc(50% - var(--loader-size)/2);position:absolute;top:calc(50% - var(--loader-size)/2)}.group{--group-border-width:1px;display:flex}.group>:where(*):focus{position:relative;z-index:1}.group[data-orientation=horizontal]{flex-direction:row}.group[data-orientation=horizontal]>:where(*):not(:only-child):first-child{border-end-end-radius:0;border-inline-end-width:calc(var(--group-border-width)/2);border-start-end-radius:0}.group[data-orientation=horizontal]>:where(*):not(:only-child):last-child{border-end-start-radius:0;border-inline-start-width:calc(var(--group-border-width)/2);border-start-start-radius:0}.group[data-orientation=horizontal]>:where(*):not(:only-child):not(:first-child):not(:last-child){border-inline-width:calc(var(--group-border-width)/2);border-radius:0}.group[data-orientation=vertical]{flex-direction:column}.group[data-orientation=vertical]>:where(*):not(:only-child):first-child{border-bottom-width:calc(var(--group-border-width)/2);border-end-end-radius:0;border-end-start-radius:0}.group[data-orientation=vertical]>:where(*):not(:only-child):last-child{border-start-end-radius:0;border-start-start-radius:0;border-top-width:calc(var(--group-border-width)/2)}.group[data-orientation=vertical]>:where(*):not(:only-child):not(:first-child):not(:last-child){border-bottom-width:calc(var(--group-border-width)/2);border-radius:0;border-top-width:calc(var(--group-border-width)/2)}
|
|
@@ -1,62 +1,57 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import {
|
|
2
|
+
import { useVarsResolver } from "@nui/composables";
|
|
3
3
|
import { createVariantColorResolver, getFontSize, getRadius, getSize, getSpacing } from "@nui/utils";
|
|
4
|
-
import { computed } from "vue";
|
|
5
4
|
import Box from "../box.vue";
|
|
6
5
|
import Loader from "../loader/loader.vue";
|
|
7
6
|
import css from "./button.module.css";
|
|
8
7
|
const {
|
|
9
|
-
|
|
10
|
-
size,
|
|
8
|
+
is = "button",
|
|
11
9
|
variant = "default",
|
|
12
|
-
spacing,
|
|
13
|
-
gradient,
|
|
14
|
-
loading,
|
|
15
|
-
classes,
|
|
16
|
-
icon,
|
|
17
10
|
leftSectionPE = "none",
|
|
18
|
-
leftSectionProps,
|
|
19
11
|
rightSectionPE = "all",
|
|
12
|
+
mod,
|
|
13
|
+
icon,
|
|
14
|
+
loading,
|
|
15
|
+
classes,
|
|
20
16
|
rightSectionProps,
|
|
21
|
-
|
|
22
|
-
radius,
|
|
23
|
-
mod: _mod
|
|
17
|
+
...props
|
|
24
18
|
} = defineProps({
|
|
19
|
+
color: { type: null, required: false },
|
|
25
20
|
size: { type: null, required: false },
|
|
26
|
-
spacing: { type: String, required: false },
|
|
27
|
-
variant: { type: String, required: false },
|
|
21
|
+
spacing: { type: [String, Number, Object], required: false },
|
|
28
22
|
gradient: { type: Object, required: false },
|
|
23
|
+
radius: { type: [String, Number, Object], required: false },
|
|
24
|
+
justify: { type: void 0, required: false },
|
|
25
|
+
leftSectionPE: { type: void 0, required: false },
|
|
26
|
+
rightSectionPE: { type: void 0, required: false },
|
|
29
27
|
loading: { type: Boolean, required: false },
|
|
30
|
-
color: { type: null, required: false },
|
|
31
|
-
radius: { type: [String, Number], required: false },
|
|
32
|
-
classes: { type: Object, required: false },
|
|
33
|
-
leftSectionPE: { type: null, required: false },
|
|
34
|
-
leftSectionProps: { type: Object, required: false },
|
|
35
28
|
icon: { type: String, required: false },
|
|
36
|
-
|
|
29
|
+
leftSectionProps: { type: Object, required: false },
|
|
37
30
|
rightSectionProps: { type: Object, required: false },
|
|
31
|
+
variant: { type: String, required: false },
|
|
32
|
+
classes: { type: Object, required: false },
|
|
38
33
|
is: { type: null, required: false },
|
|
39
34
|
mod: { type: [Object, Array, null], required: false }
|
|
40
35
|
});
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
} = createVariantColorResolver({ variant, color, theme, gradient });
|
|
36
|
+
const style = useVarsResolver((theme) => {
|
|
37
|
+
const { background, border, hover, text } = createVariantColorResolver({
|
|
38
|
+
theme,
|
|
39
|
+
variant,
|
|
40
|
+
color: props.color,
|
|
41
|
+
gradient: props.gradient
|
|
42
|
+
});
|
|
49
43
|
return {
|
|
50
44
|
root: {
|
|
51
|
-
"--button-
|
|
52
|
-
"--button-
|
|
53
|
-
"--button-
|
|
45
|
+
"--button-justify": props.justify,
|
|
46
|
+
"--button-height": getSize(props.size, "button-height"),
|
|
47
|
+
"--button-padding-x": getSize(props.size, "button-padding-x"),
|
|
48
|
+
"--button-fz": props.size?.includes("compact") ? getFontSize(props.size.replace("compact-", "")) : getFontSize(props.size),
|
|
54
49
|
"--button-bg": background,
|
|
55
50
|
"--button-hover": hover,
|
|
56
51
|
"--button-color": text,
|
|
57
52
|
"--button-bd": border,
|
|
58
|
-
"--button-radius": getRadius(radius),
|
|
59
|
-
"--button-spacing": getSpacing(spacing)
|
|
53
|
+
"--button-radius": getRadius(props.radius),
|
|
54
|
+
"--button-spacing": getSpacing(props.spacing)
|
|
60
55
|
},
|
|
61
56
|
leftSection: {
|
|
62
57
|
"--section-pointer-events": leftSectionPE
|
|
@@ -65,20 +60,19 @@ const style = computed(() => useStyleResolver((theme) => {
|
|
|
65
60
|
"--section-pointer-events": rightSectionPE
|
|
66
61
|
}
|
|
67
62
|
};
|
|
68
|
-
})
|
|
63
|
+
});
|
|
69
64
|
</script>
|
|
70
65
|
|
|
71
66
|
<template>
|
|
72
67
|
<Box
|
|
73
68
|
:is
|
|
74
69
|
type='button'
|
|
75
|
-
:mod='[
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
]'
|
|
70
|
+
:mod='[mod, {
|
|
71
|
+
"with-left-section": !!$slots?.leftSection || !!icon,
|
|
72
|
+
"with-right-section": !!$slots?.rightSection,
|
|
73
|
+
loading,
|
|
74
|
+
variant
|
|
75
|
+
}]'
|
|
82
76
|
:style='style.root'
|
|
83
77
|
:class='[css.root, classes?.root]'
|
|
84
78
|
:disabled='loading'
|
|
@@ -1,42 +1,37 @@
|
|
|
1
|
-
import type { Classes, NuanceColor, NuanceGradient, NuanceRadius, NuanceSize } from '@nui/types';
|
|
2
|
-
import type { HTMLAttributes } from 'vue';
|
|
1
|
+
import type { AnyString, Classes, NuanceColor, NuanceGradient, NuanceRadius, NuanceSize, NuanceSpacing } from '@nui/types';
|
|
2
|
+
import type { CSSProperties, HTMLAttributes } from 'vue';
|
|
3
3
|
import type { BoxProps } from '../box.vue.js';
|
|
4
|
+
export type ButtonClasses = 'root' | 'inner' | 'label' | 'section';
|
|
5
|
+
export type ButtonVariant = 'filled' | 'light' | 'outline' | 'subtle' | 'default' | 'gradient' | 'gradient-outline';
|
|
4
6
|
export interface ButtonProps extends BoxProps {
|
|
7
|
+
/** Color from theme */
|
|
8
|
+
color?: NuanceColor;
|
|
5
9
|
/** Component size */
|
|
6
10
|
size?: NuanceSize | `compact-${NuanceSize}`;
|
|
7
11
|
/** Spacing token */
|
|
8
|
-
spacing?:
|
|
9
|
-
/**
|
|
10
|
-
* Visual variant
|
|
11
|
-
* @default `'default'`
|
|
12
|
-
*/
|
|
13
|
-
variant?: 'filled' | 'light' | 'outline' | 'subtle' | 'default' | 'gradient' | 'gradient-outline';
|
|
12
|
+
spacing?: NuanceSpacing | AnyString;
|
|
14
13
|
/** Gradient configuration (used with `variant="gradient"`) */
|
|
15
14
|
gradient?: NuanceGradient;
|
|
15
|
+
/** Border radius */
|
|
16
|
+
radius?: NuanceRadius | AnyString;
|
|
17
|
+
/** Sets `justify-content` of `inner` element @default 'center' */
|
|
18
|
+
justify?: CSSProperties['justify-content'];
|
|
19
|
+
/** `pointer-events` value for the left section @default `'none'` */
|
|
20
|
+
leftSectionPE?: CSSProperties['pointer-events'];
|
|
21
|
+
/** `pointer-events` value for the right section @default `'all'` */
|
|
22
|
+
rightSectionPE?: CSSProperties['pointer-events'];
|
|
16
23
|
/** Loading state */
|
|
17
24
|
loading?: boolean;
|
|
18
|
-
/** Color from theme */
|
|
19
|
-
color?: NuanceColor;
|
|
20
|
-
/** Border radius */
|
|
21
|
-
radius?: NuanceRadius;
|
|
22
|
-
/** Styles API */
|
|
23
|
-
classes?: Classes<'root' | 'inner' | 'label' | 'section'>;
|
|
24
|
-
/**
|
|
25
|
-
* `pointer-events` value for the left section
|
|
26
|
-
* @default `'none'`
|
|
27
|
-
*/
|
|
28
|
-
leftSectionPE?: CSSStyleDeclaration['pointerEvents'];
|
|
29
|
-
/** Extra attributes forwarded to the left section element */
|
|
30
|
-
leftSectionProps?: HTMLAttributes;
|
|
31
25
|
/** Icon displayed before the label */
|
|
32
26
|
icon?: string;
|
|
33
|
-
/**
|
|
34
|
-
|
|
35
|
-
* @default `'all'`
|
|
36
|
-
*/
|
|
37
|
-
rightSectionPE?: CSSStyleDeclaration['pointerEvents'];
|
|
27
|
+
/** Extra attributes forwarded to the left section element */
|
|
28
|
+
leftSectionProps?: HTMLAttributes;
|
|
38
29
|
/** Extra attributes forwarded to the right section element */
|
|
39
30
|
rightSectionProps?: HTMLAttributes;
|
|
31
|
+
/** Visual variant */
|
|
32
|
+
variant?: ButtonVariant;
|
|
33
|
+
/** Styles API */
|
|
34
|
+
classes?: Classes<ButtonClasses>;
|
|
40
35
|
}
|
|
41
36
|
declare var __VLS_19: {}, __VLS_26: {}, __VLS_28: {};
|
|
42
37
|
type __VLS_Slots = {} & {
|
|
@@ -14,25 +14,6 @@ const { is = "button", ...props } = defineProps({
|
|
|
14
14
|
</Box>
|
|
15
15
|
</template>
|
|
16
16
|
|
|
17
|
-
<style module
|
|
18
|
-
:where(.unstyled) {
|
|
19
|
-
touch-action: manipulation;
|
|
20
|
-
cursor: pointer;
|
|
21
|
-
|
|
22
|
-
padding: 0;
|
|
23
|
-
border: 0;
|
|
24
|
-
|
|
25
|
-
font-size: var(--font-size-md);
|
|
26
|
-
color: inherit;
|
|
27
|
-
text-align: left;
|
|
28
|
-
text-decoration: none;
|
|
29
|
-
|
|
30
|
-
appearance: none;
|
|
31
|
-
background-color: transparent;
|
|
32
|
-
-webkit-tap-highlight-color: transparent;
|
|
33
|
-
|
|
34
|
-
@mixin where-rtl {
|
|
35
|
-
text-align: right;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
17
|
+
<style module>
|
|
18
|
+
:where(.unstyled){-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent;border:0;color:inherit;cursor:pointer;font-size:var(--font-size-md);padding:0;text-align:left;text-decoration:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent;@mixin where-rtl{text-align:right}}
|
|
38
19
|
</style>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { DateInput } from '@formkit/tempo';
|
|
2
|
-
import type { NuanceSize } from '@nui/types';
|
|
2
|
+
import type { AnyString, NuanceSize } from '@nui/types';
|
|
3
3
|
import type { CalendarLevel, DateSelection, SelectionMode } from './types.js';
|
|
4
4
|
import type { CalendarRootProps } from './ui/core/index.js';
|
|
5
5
|
export interface CalendarProps<T extends SelectionMode = 'single'> extends CalendarRootProps<T> {
|
|
6
6
|
/** Component size */
|
|
7
|
-
size?: NuanceSize |
|
|
7
|
+
size?: NuanceSize | AnyString;
|
|
8
8
|
/** Determines whether week numbers should be displayed @default `false` */
|
|
9
9
|
withWeekNumbers?: boolean;
|
|
10
10
|
/** Callback function to determine whether the prev button should be disabled */
|
|
@@ -3,7 +3,7 @@ import { useCalendarNavigation } from "./lib/use-calendar-navigation";
|
|
|
3
3
|
import { CalendarHeader, CalendarRoot } from "./ui/core";
|
|
4
4
|
import { CalendarDecade, CalendarMonth, CalendarYear } from "./ui/levels";
|
|
5
5
|
const props = defineProps({
|
|
6
|
-
size: { type: String, required: false },
|
|
6
|
+
size: { type: [String, Object], required: false },
|
|
7
7
|
withWeekNumbers: { type: Boolean, required: false, default: false },
|
|
8
8
|
prevDisabled: { type: Function, required: false },
|
|
9
9
|
nextDisabled: { type: Function, required: false },
|
|
@@ -115,13 +115,6 @@ const [calendars, nav] = useCalendarNavigation({
|
|
|
115
115
|
</CalendarRoot>
|
|
116
116
|
</template>
|
|
117
117
|
|
|
118
|
-
<style
|
|
119
|
-
.content
|
|
120
|
-
--calendar-cell-spacing: rem(1px);
|
|
121
|
-
|
|
122
|
-
display: flex;
|
|
123
|
-
gap: var(--spacing-sm);
|
|
124
|
-
|
|
125
|
-
width: fit-content;
|
|
126
|
-
}
|
|
118
|
+
<style module>
|
|
119
|
+
.content{--calendar-cell-spacing:rem(1px);display:flex;gap:var(--spacing-sm);width:-moz-fit-content;width:fit-content}
|
|
127
120
|
</style>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { DateInput } from '@formkit/tempo';
|
|
2
|
-
import type { NuanceSize } from '@nui/types';
|
|
2
|
+
import type { AnyString, NuanceSize } from '@nui/types';
|
|
3
3
|
import type { CalendarLevel, DateSelection, SelectionMode } from './types.js';
|
|
4
4
|
import type { CalendarRootProps } from './ui/core/index.js';
|
|
5
5
|
export interface CalendarProps<T extends SelectionMode = 'single'> extends CalendarRootProps<T> {
|
|
6
6
|
/** Component size */
|
|
7
|
-
size?: NuanceSize |
|
|
7
|
+
size?: NuanceSize | AnyString;
|
|
8
8
|
/** Determines whether week numbers should be displayed @default `false` */
|
|
9
9
|
withWeekNumbers?: boolean;
|
|
10
10
|
/** Callback function to determine whether the prev button should be disabled */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { NuanceSize } from '@nui/types';
|
|
1
|
+
import type { AnyString, NuanceSize } from '@nui/types';
|
|
2
2
|
import type { BoxProps } from '../../../box.vue.js';
|
|
3
3
|
export interface CalendarCellProps extends BoxProps {
|
|
4
4
|
/** Component size */
|
|
5
|
-
size?: NuanceSize |
|
|
5
|
+
size?: NuanceSize | AnyString;
|
|
6
6
|
}
|
|
7
7
|
declare var __VLS_8: {};
|
|
8
8
|
type __VLS_Slots = {} & {
|
|
@@ -3,7 +3,7 @@ import { getSize } from "@nui/utils";
|
|
|
3
3
|
import { computed } from "vue";
|
|
4
4
|
import UnstyledButton from "../../../button/unstyled-button.vue";
|
|
5
5
|
const props = defineProps({
|
|
6
|
-
size: { type: String, required: false },
|
|
6
|
+
size: { type: [String, Object], required: false },
|
|
7
7
|
is: { type: null, required: false },
|
|
8
8
|
mod: { type: [Object, Array, null], required: false }
|
|
9
9
|
});
|
|
@@ -18,117 +18,6 @@ const style = computed(() => ({
|
|
|
18
18
|
</UnstyledButton>
|
|
19
19
|
</template>
|
|
20
20
|
|
|
21
|
-
<style
|
|
22
|
-
.cell {
|
|
23
|
-
--day-size-xs: rem(30px);
|
|
24
|
-
--day-size-sm: rem(36px);
|
|
25
|
-
--day-size-md: rem(42px);
|
|
26
|
-
--day-size-lg: rem(48px);
|
|
27
|
-
--day-size-xl: rem(54px);
|
|
28
|
-
--day-size: var(--day-size-sm);
|
|
29
|
-
|
|
30
|
-
cursor: pointer;
|
|
31
|
-
user-select: none;
|
|
32
|
-
|
|
33
|
-
display: inline-flex;
|
|
34
|
-
align-items: center;
|
|
35
|
-
justify-content: center;
|
|
36
|
-
|
|
37
|
-
width: var(--day-size, var(--day-size-sm));
|
|
38
|
-
height: var(--day-size, var(--day-size-sm));
|
|
39
|
-
border-radius: var(--radius-default);
|
|
40
|
-
|
|
41
|
-
font-size: calc(var(--day-size) / 2.8);
|
|
42
|
-
color: var(--color-text);
|
|
43
|
-
|
|
44
|
-
background-color: transparent;
|
|
45
|
-
|
|
46
|
-
&:hover {
|
|
47
|
-
&:where(:not([data-static], &:disabled, [data-selected], [data-in-range])) {
|
|
48
|
-
@mixin light {
|
|
49
|
-
background-color: var(--color-gray-0);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
@mixin dark {
|
|
53
|
-
background-color: var(--color-dark-5);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
&:where([data-static]) {
|
|
59
|
-
cursor: default;
|
|
60
|
-
user-select: auto;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
&:where([data-weekend]) {
|
|
64
|
-
color: var(--color-red-6);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
&:where([data-outside]) {
|
|
68
|
-
/* stylelint-disable-next-line function-no-unknown */
|
|
69
|
-
color: alpha(var(--color-dimmed), .5);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
&:where([data-hidden]) {
|
|
73
|
-
display: none;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
&:where([data-today]:not([data-selected], [data-in-range])) {
|
|
77
|
-
@mixin where-light {
|
|
78
|
-
border: 1px solid var(--color-gray-4);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
@mixin where-dark {
|
|
82
|
-
border: 1px solid var(--color-dark-4);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
&:where([data-in-range]) {
|
|
87
|
-
border-radius: 0;
|
|
88
|
-
|
|
89
|
-
background-color: var(--color-primary-light-hover);
|
|
90
|
-
|
|
91
|
-
&:hover {
|
|
92
|
-
&:where(:not(:disabled, [data-static])) {
|
|
93
|
-
background-color: var(--color-primary-light);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
&:where([data-first-in-range]) {
|
|
99
|
-
border-radius: 0;
|
|
100
|
-
border-start-start-radius: var(--radius-default);
|
|
101
|
-
border-end-start-radius: var(--radius-default);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
&:where([data-last-in-range]) {
|
|
105
|
-
border-radius: 0;
|
|
106
|
-
border-start-end-radius: var(--radius-default);
|
|
107
|
-
border-end-end-radius: var(--radius-default);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
&:where([data-last-in-range][data-first-in-range]) {
|
|
111
|
-
border-radius: var(--radius-default);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
&:where([data-selected]) {
|
|
115
|
-
color: var(--color-white);
|
|
116
|
-
|
|
117
|
-
background-color: var(--color-primary-filled);
|
|
118
|
-
|
|
119
|
-
&:hover {
|
|
120
|
-
&:where(:not(:disabled, [data-static])) {
|
|
121
|
-
background-color: var(--color-primary-filled-hover);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
&:where(:disabled) {
|
|
127
|
-
pointer-events: none;
|
|
128
|
-
cursor: not-allowed;
|
|
129
|
-
|
|
130
|
-
/* stylelint-disable-next-line function-no-unknown */
|
|
131
|
-
color: alpha(var(--color-disabled), .5);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
21
|
+
<style module>
|
|
22
|
+
.cell{--day-size-xs:rem(30px);--day-size-sm:rem(36px);--day-size-md:rem(42px);--day-size-lg:rem(48px);--day-size-xl:rem(54px);--day-size:var(--day-size-sm);align-items:center;background-color:transparent;border-radius:var(--radius-default);color:var(--color-text);cursor:pointer;display:inline-flex;font-size:calc(var(--day-size)/2.8);height:var(--day-size,var(--day-size-sm));justify-content:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:var(--day-size,var(--day-size-sm))}.cell:hover:where(:not([data-static],.cell:hover:disabled,[data-selected],[data-in-range])){@mixin light{background-color:var(--color-gray-0)}@mixin dark{background-color:var(--color-dark-5)}}.cell:where([data-static]){cursor:default;-webkit-user-select:auto;-moz-user-select:auto;user-select:auto}.cell:where([data-weekend]){color:var(--color-red-6)}.cell:where([data-outside]){color:alpha(var(--color-dimmed),.5)}.cell:where([data-hidden]){display:none}.cell:where([data-today]:not([data-selected],[data-in-range])){@mixin where-light{border-bottom-color:var(--color-gray-4);border-bottom-style:solid;border-bottom-width:1px;border-left-color:var(--color-gray-4);border-left-style:solid;border-left-width:1px;border-right-color:var(--color-gray-4);border-right-style:solid;border-right-width:1px;border-top-color:var(--color-gray-4);border-top-style:solid;border-top-width:1px}@mixin where-dark{border-bottom-color:var(--color-dark-4);border-bottom-style:solid;border-bottom-width:1px;border-left-color:var(--color-dark-4);border-left-style:solid;border-left-width:1px;border-right-color:var(--color-dark-4);border-right-style:solid;border-right-width:1px;border-top-color:var(--color-dark-4);border-top-style:solid;border-top-width:1px}}.cell:where([data-in-range]){background-color:var(--color-primary-light-hover);border-radius:0}.cell:where([data-in-range]):hover:where(:not(:disabled,[data-static])){background-color:var(--color-primary-light)}.cell:where([data-first-in-range]){border-radius:0;border-end-start-radius:var(--radius-default);border-start-start-radius:var(--radius-default)}.cell:where([data-last-in-range]){border-radius:0;border-end-end-radius:var(--radius-default);border-start-end-radius:var(--radius-default)}.cell:where([data-last-in-range][data-first-in-range]){border-radius:var(--radius-default)}.cell:where([data-selected]){background-color:var(--color-primary-filled);color:var(--color-white)}.cell:where([data-selected]):hover:where(:not(:disabled,[data-static])){background-color:var(--color-primary-filled-hover)}.cell:where(:disabled){color:alpha(var(--color-disabled),.5);cursor:not-allowed;pointer-events:none}
|
|
134
23
|
</style>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { NuanceSize } from '@nui/types';
|
|
1
|
+
import type { AnyString, NuanceSize } from '@nui/types';
|
|
2
2
|
import type { BoxProps } from '../../../box.vue.js';
|
|
3
3
|
export interface CalendarCellProps extends BoxProps {
|
|
4
4
|
/** Component size */
|
|
5
|
-
size?: NuanceSize |
|
|
5
|
+
size?: NuanceSize | AnyString;
|
|
6
6
|
}
|
|
7
7
|
declare var __VLS_8: {};
|
|
8
8
|
type __VLS_Slots = {} & {
|