nuance-ui 0.2.8 → 0.2.10
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/LICENSE.md +9 -9
- package/README.md +75 -75
- package/dist/module.json +1 -1
- package/dist/runtime/components/action-icon/action-icon-group.vue +3 -3
- package/dist/runtime/components/action-icon/action-icon.vue +23 -23
- package/dist/runtime/components/app-shell/app-shell-aside.vue +30 -30
- package/dist/runtime/components/app-shell/app-shell-footer.vue +29 -29
- package/dist/runtime/components/app-shell/app-shell-header.vue +30 -30
- package/dist/runtime/components/app-shell/app-shell-main.vue +18 -18
- package/dist/runtime/components/app-shell/app-shell-navbar.vue +34 -34
- package/dist/runtime/components/app-shell/app-shell-section.vue +10 -10
- package/dist/runtime/components/app-shell/app-shell.vue +34 -34
- package/dist/runtime/components/box.vue +3 -3
- package/dist/runtime/components/breadcrumbs.vue +78 -78
- package/dist/runtime/components/button/button.d.vue.ts +5 -0
- package/dist/runtime/components/button/button.module.css +1 -1
- package/dist/runtime/components/button/button.vue +44 -41
- package/dist/runtime/components/button/button.vue.d.ts +5 -0
- package/dist/runtime/components/button/unstyled-button.vue +23 -23
- package/dist/runtime/components/calendar/calendar.vue +60 -60
- package/dist/runtime/components/calendar/ui/core/calendar-header.vue +95 -95
- package/dist/runtime/components/calendar/ui/core/calendar-root.vue +3 -3
- package/dist/runtime/components/calendar/ui/levels/calendar-decade.vue +40 -40
- package/dist/runtime/components/calendar/ui/levels/calendar-month.vue +77 -77
- package/dist/runtime/components/calendar/ui/levels/calendar-year.vue +40 -40
- package/dist/runtime/components/card/card-section.vue +3 -3
- package/dist/runtime/components/card/card.vue +3 -3
- package/dist/runtime/components/checkbox/checkbox-card.vue +37 -37
- package/dist/runtime/components/checkbox/checkbox-indicator.vue +117 -117
- package/dist/runtime/components/checkbox/checkbox.vue +139 -139
- package/dist/runtime/components/chip/chip-group.vue +2 -2
- package/dist/runtime/components/chip/chip.vue +200 -200
- package/dist/runtime/components/combobox/combobox-dropdown.vue +14 -14
- package/dist/runtime/components/combobox/combobox-empty.vue +3 -3
- package/dist/runtime/components/combobox/combobox-group.vue +21 -21
- package/dist/runtime/components/combobox/combobox-option-list.vue +3 -3
- package/dist/runtime/components/combobox/combobox-option.vue +22 -22
- package/dist/runtime/components/combobox/combobox-options-dropdown.vue +29 -29
- package/dist/runtime/components/combobox/combobox-root.vue +3 -3
- package/dist/runtime/components/combobox/combobox-target.vue +3 -3
- package/dist/runtime/components/container.vue +8 -8
- package/dist/runtime/components/date-time-picker.d.vue.ts +3 -3
- package/dist/runtime/components/date-time-picker.vue +66 -66
- package/dist/runtime/components/date-time-picker.vue.d.ts +3 -3
- package/dist/runtime/components/dialog/ui/dialog-close-button.vue +11 -11
- package/dist/runtime/components/dialog/ui/dialog-header.vue +5 -5
- package/dist/runtime/components/dialog/ui/dialog-title.vue +5 -5
- package/dist/runtime/components/drawer/drawer-close-button.vue +3 -3
- package/dist/runtime/components/drawer/drawer-header.vue +3 -3
- package/dist/runtime/components/drawer/drawer-root.vue +15 -15
- package/dist/runtime/components/drawer/drawer-title.vue +3 -3
- package/dist/runtime/components/files/file-upload-button.vue +13 -12
- package/dist/runtime/components/files/file-upload-icon.vue +1 -1
- package/dist/runtime/components/input/date-picker.vue +85 -85
- package/dist/runtime/components/input/email-input.vue +19 -19
- package/dist/runtime/components/input/number-input.vue +134 -134
- package/dist/runtime/components/input/password-input.vue +28 -28
- package/dist/runtime/components/input/text-input.vue +35 -35
- package/dist/runtime/components/input/ui/input-inline.vue +105 -105
- package/dist/runtime/components/input/ui/input-wrapper.vue +54 -54
- package/dist/runtime/components/link/link-button.vue +17 -16
- package/dist/runtime/components/link/link.vue +10 -10
- package/dist/runtime/components/loader/_loaders/bars-loader.vue +5 -5
- package/dist/runtime/components/loader/_loaders/dots-loader.vue +5 -5
- package/dist/runtime/components/loader/_loaders/oval-loader.vue +1 -1
- package/dist/runtime/components/modal/modal-close-button.vue +3 -3
- package/dist/runtime/components/modal/modal-header.vue +3 -3
- package/dist/runtime/components/modal/modal-root.vue +13 -13
- package/dist/runtime/components/modal/modal-title.vue +3 -3
- package/dist/runtime/components/nav-link/nav-icon-link.vue +15 -15
- package/dist/runtime/components/nav-link/nav-link.vue +132 -132
- package/dist/runtime/components/paper.vue +33 -33
- package/dist/runtime/components/popover/popover-dropdown.vue +69 -70
- package/dist/runtime/components/popover/popover-target.vue +8 -8
- package/dist/runtime/components/popover/popover.vue +1 -1
- package/dist/runtime/components/progress/progress-label.vue +3 -3
- package/dist/runtime/components/progress/progress-root.vue +3 -3
- package/dist/runtime/components/progress/progress-section.vue +8 -8
- package/dist/runtime/components/progress/progress.vue +9 -9
- package/dist/runtime/components/renderless/renderless.vue +3 -3
- package/dist/runtime/components/roving-focus/roving-focus-item.vue +14 -14
- package/dist/runtime/components/select.vue +63 -63
- package/dist/runtime/components/switch/switch-group.vue +16 -16
- package/dist/runtime/components/table/table.d.ts +30 -30
- package/dist/runtime/components/table/ui/table-sortable-header.vue +12 -11
- package/dist/runtime/components/tabs/tabs-list.vue +10 -10
- package/dist/runtime/components/tabs/tabs-panel.vue +11 -11
- package/dist/runtime/components/tabs/tabs-root.vue +8 -8
- package/dist/runtime/components/tabs/tabs-tab.vue +22 -22
- package/dist/runtime/components/text.vue +67 -67
- package/dist/runtime/components/textarea.vue +36 -36
- package/dist/runtime/components/title.vue +14 -14
- package/dist/runtime/components/transition.vue +3 -3
- package/dist/runtime/components/tree/_ui/tree-item.vue +128 -129
- package/dist/runtime/components/tree/_ui/tree-root.vue +21 -21
- package/dist/runtime/components/visually-hidden/visually-hidden-input.vue +1 -1
- package/dist/runtime/components/visually-hidden/visually-hidden.vue +9 -9
- package/dist/runtime/composables/use-style-resolver.d.ts +2 -3
- package/dist/runtime/styles/dark-theme.css +1 -1
- package/dist/runtime/types/index.d.ts +1 -0
- package/dist/runtime/types/styling.d.ts +4 -0
- package/dist/runtime/types/styling.js +0 -0
- package/dist/runtime/utils/color/parse-theme-color.d.ts +2 -2
- package/package.json +1 -1
|
@@ -33,85 +33,85 @@ const breadcrumbs = computed(() => unref(items) ?? []);
|
|
|
33
33
|
</script>
|
|
34
34
|
|
|
35
35
|
<template>
|
|
36
|
-
<Box :is :mod :style :class='$style.root' aria-label='breadcrumb'>
|
|
37
|
-
<template v-for='(item, ix) in breadcrumbs' :key='item.to'>
|
|
38
|
-
<li :class='$style.breadcrumb' role='presentation' aria-hidden='true'>
|
|
39
|
-
<slot
|
|
40
|
-
:name='item.slot ?? "item"'
|
|
41
|
-
:item='item'
|
|
42
|
-
:ix='ix'
|
|
43
|
-
:active='item.active ?? ix === breadcrumbs.length - 1'
|
|
44
|
-
>
|
|
45
|
-
<Button
|
|
46
|
-
:size
|
|
47
|
-
:variant
|
|
48
|
-
:class='$style.item'
|
|
49
|
-
:mod='{ active: item.active ?? ix === breadcrumbs.length - 1 }'
|
|
50
|
-
:color='item.active ?? ix === breadcrumbs.length - 1 ? color : inactive'
|
|
51
|
-
@click.stop.prevent='$emit("click", item)'
|
|
52
|
-
>
|
|
53
|
-
<template v-if='item?.icon' #leftSection>
|
|
54
|
-
<Icon :name='item.icon' :class='$style.icon' />
|
|
55
|
-
</template>
|
|
56
|
-
{{ item.label }}
|
|
57
|
-
</Button>
|
|
58
|
-
</slot>
|
|
59
|
-
</li>
|
|
60
|
-
<li v-if='ix < breadcrumbs.length - 1' role='presentation' aria-hidden='true' :class='$style.separator'>
|
|
61
|
-
<slot name='separator'>
|
|
62
|
-
<Icon :name='separator' />
|
|
63
|
-
</slot>
|
|
64
|
-
</li>
|
|
65
|
-
</template>
|
|
66
|
-
</Box>
|
|
36
|
+
<Box :is :mod :style :class='$style.root' aria-label='breadcrumb'>
|
|
37
|
+
<template v-for='(item, ix) in breadcrumbs' :key='item.to'>
|
|
38
|
+
<li :class='$style.breadcrumb' role='presentation' aria-hidden='true'>
|
|
39
|
+
<slot
|
|
40
|
+
:name='item.slot ?? "item"'
|
|
41
|
+
:item='item'
|
|
42
|
+
:ix='ix'
|
|
43
|
+
:active='item.active ?? ix === breadcrumbs.length - 1'
|
|
44
|
+
>
|
|
45
|
+
<Button
|
|
46
|
+
:size
|
|
47
|
+
:variant
|
|
48
|
+
:class='$style.item'
|
|
49
|
+
:mod='{ active: item.active ?? ix === breadcrumbs.length - 1 }'
|
|
50
|
+
:color='item.active ?? ix === breadcrumbs.length - 1 ? color : inactive'
|
|
51
|
+
@click.stop.prevent='$emit("click", item)'
|
|
52
|
+
>
|
|
53
|
+
<template v-if='item?.icon' #leftSection>
|
|
54
|
+
<Icon :name='item.icon' :class='$style.icon' />
|
|
55
|
+
</template>
|
|
56
|
+
{{ item.label }}
|
|
57
|
+
</Button>
|
|
58
|
+
</slot>
|
|
59
|
+
</li>
|
|
60
|
+
<li v-if='ix < breadcrumbs.length - 1' role='presentation' aria-hidden='true' :class='$style.separator'>
|
|
61
|
+
<slot name='separator'>
|
|
62
|
+
<Icon :name='separator' />
|
|
63
|
+
</slot>
|
|
64
|
+
</li>
|
|
65
|
+
</template>
|
|
66
|
+
</Box>
|
|
67
67
|
</template>
|
|
68
68
|
|
|
69
69
|
<style module lang="postcss">
|
|
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
|
-
}
|
|
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
|
+
}
|
|
117
117
|
</style>
|
|
@@ -37,6 +37,11 @@ export interface ButtonProps extends BoxProps {
|
|
|
37
37
|
rightSectionPE?: CSSStyleDeclaration['pointerEvents'];
|
|
38
38
|
/** Extra attributes forwarded to the right section element */
|
|
39
39
|
rightSectionProps?: HTMLAttributes;
|
|
40
|
+
/**
|
|
41
|
+
* Sets `justify-content` of `inner` element, can be used to change distribution of sections and label
|
|
42
|
+
* @default 'center'
|
|
43
|
+
*/
|
|
44
|
+
justify?: CSSStyleDeclaration['justifyContent'];
|
|
40
45
|
}
|
|
41
46
|
declare var __VLS_19: {}, __VLS_26: {}, __VLS_28: {};
|
|
42
47
|
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)}
|
|
@@ -20,7 +20,8 @@ const {
|
|
|
20
20
|
rightSectionProps,
|
|
21
21
|
is = "button",
|
|
22
22
|
radius,
|
|
23
|
-
mod: _mod
|
|
23
|
+
mod: _mod,
|
|
24
|
+
justify
|
|
24
25
|
} = defineProps({
|
|
25
26
|
size: { type: null, required: false },
|
|
26
27
|
spacing: { type: String, required: false },
|
|
@@ -35,6 +36,7 @@ const {
|
|
|
35
36
|
icon: { type: String, required: false },
|
|
36
37
|
rightSectionPE: { type: null, required: false },
|
|
37
38
|
rightSectionProps: { type: Object, required: false },
|
|
39
|
+
justify: { type: null, required: false },
|
|
38
40
|
is: { type: null, required: false },
|
|
39
41
|
mod: { type: [Object, Array, null], required: false }
|
|
40
42
|
});
|
|
@@ -48,6 +50,7 @@ const style = computed(() => useStyleResolver((theme) => {
|
|
|
48
50
|
} = createVariantColorResolver({ variant, color, theme, gradient });
|
|
49
51
|
return {
|
|
50
52
|
root: {
|
|
53
|
+
"--button-justify": justify,
|
|
51
54
|
"--button-height": getSize(size, "button-height"),
|
|
52
55
|
"--button-padding-x": getSize(size, "button-padding-x"),
|
|
53
56
|
"--button-fz": size?.includes("compact") ? getFontSize(size.replace("compact-", "")) : getFontSize(size),
|
|
@@ -69,50 +72,50 @@ const style = computed(() => useStyleResolver((theme) => {
|
|
|
69
72
|
</script>
|
|
70
73
|
|
|
71
74
|
<template>
|
|
72
|
-
<Box
|
|
73
|
-
:is
|
|
74
|
-
type='button'
|
|
75
|
+
<Box
|
|
76
|
+
:is
|
|
77
|
+
type='button'
|
|
75
78
|
:mod='[
|
|
76
79
|
{
|
|
77
80
|
"with-left-section": !!$slots?.leftSection || !!icon,
|
|
78
81
|
"with-right-section": !!$slots?.rightSection
|
|
79
82
|
},
|
|
80
83
|
mod
|
|
81
|
-
]'
|
|
82
|
-
:style='style.root'
|
|
83
|
-
:class='[css.root, classes?.root]'
|
|
84
|
-
:disabled='loading'
|
|
85
|
-
>
|
|
86
|
-
<Transition name='fade-down'>
|
|
87
|
-
<Loader v-show='loading' :class='css.loader' :color :size />
|
|
88
|
-
</Transition>
|
|
89
|
-
|
|
90
|
-
<span :class='[css.inner, classes?.inner]'>
|
|
91
|
-
<span
|
|
92
|
-
v-if='$slots.leftSection || icon'
|
|
93
|
-
:class='[css.section, classes?.section]'
|
|
94
|
-
data-position='left'
|
|
95
|
-
v-bind='leftSectionProps'
|
|
96
|
-
:style='style.leftSection'
|
|
97
|
-
>
|
|
98
|
-
<slot name='leftSection'>
|
|
99
|
-
<Icon v-if='icon' :name='icon' />
|
|
100
|
-
</slot>
|
|
101
|
-
</span>
|
|
102
|
-
|
|
103
|
-
<span :class='[css.label, classes?.label]'>
|
|
104
|
-
<slot />
|
|
105
|
-
</span>
|
|
106
|
-
|
|
107
|
-
<span
|
|
108
|
-
v-if='$slots.rightSection'
|
|
109
|
-
data-position='right'
|
|
110
|
-
:class='[css.section, classes?.section]'
|
|
111
|
-
v-bind='rightSectionProps'
|
|
112
|
-
:style='style.rightSection'
|
|
113
|
-
>
|
|
114
|
-
<slot name='rightSection' />
|
|
115
|
-
</span>
|
|
116
|
-
</span>
|
|
117
|
-
</Box>
|
|
84
|
+
]'
|
|
85
|
+
:style='style.root'
|
|
86
|
+
:class='[css.root, classes?.root]'
|
|
87
|
+
:disabled='loading'
|
|
88
|
+
>
|
|
89
|
+
<Transition name='fade-down'>
|
|
90
|
+
<Loader v-show='loading' :class='css.loader' :color :size />
|
|
91
|
+
</Transition>
|
|
92
|
+
|
|
93
|
+
<span :class='[css.inner, classes?.inner]'>
|
|
94
|
+
<span
|
|
95
|
+
v-if='$slots.leftSection || icon'
|
|
96
|
+
:class='[css.section, classes?.section]'
|
|
97
|
+
data-position='left'
|
|
98
|
+
v-bind='leftSectionProps'
|
|
99
|
+
:style='style.leftSection'
|
|
100
|
+
>
|
|
101
|
+
<slot name='leftSection'>
|
|
102
|
+
<Icon v-if='icon' :name='icon' />
|
|
103
|
+
</slot>
|
|
104
|
+
</span>
|
|
105
|
+
|
|
106
|
+
<span :class='[css.label, classes?.label]'>
|
|
107
|
+
<slot />
|
|
108
|
+
</span>
|
|
109
|
+
|
|
110
|
+
<span
|
|
111
|
+
v-if='$slots.rightSection'
|
|
112
|
+
data-position='right'
|
|
113
|
+
:class='[css.section, classes?.section]'
|
|
114
|
+
v-bind='rightSectionProps'
|
|
115
|
+
:style='style.rightSection'
|
|
116
|
+
>
|
|
117
|
+
<slot name='rightSection' />
|
|
118
|
+
</span>
|
|
119
|
+
</span>
|
|
120
|
+
</Box>
|
|
118
121
|
</template>
|
|
@@ -37,6 +37,11 @@ export interface ButtonProps extends BoxProps {
|
|
|
37
37
|
rightSectionPE?: CSSStyleDeclaration['pointerEvents'];
|
|
38
38
|
/** Extra attributes forwarded to the right section element */
|
|
39
39
|
rightSectionProps?: HTMLAttributes;
|
|
40
|
+
/**
|
|
41
|
+
* Sets `justify-content` of `inner` element, can be used to change distribution of sections and label
|
|
42
|
+
* @default 'center'
|
|
43
|
+
*/
|
|
44
|
+
justify?: CSSStyleDeclaration['justifyContent'];
|
|
40
45
|
}
|
|
41
46
|
declare var __VLS_19: {}, __VLS_26: {}, __VLS_28: {};
|
|
42
47
|
type __VLS_Slots = {} & {
|
|
@@ -9,30 +9,30 @@ const { is = "button", ...props } = defineProps({
|
|
|
9
9
|
</script>
|
|
10
10
|
|
|
11
11
|
<template>
|
|
12
|
-
<Box :is :class='$style.unstyled' v-bind='props' type='button'>
|
|
13
|
-
<slot />
|
|
14
|
-
</Box>
|
|
12
|
+
<Box :is :class='$style.unstyled' v-bind='props' type='button'>
|
|
13
|
+
<slot />
|
|
14
|
+
</Box>
|
|
15
15
|
</template>
|
|
16
16
|
|
|
17
17
|
<style module lang="postcss">
|
|
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
|
-
}
|
|
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
|
+
}
|
|
38
38
|
</style>
|
|
@@ -42,86 +42,86 @@ const [calendars, nav] = useCalendarNavigation({
|
|
|
42
42
|
</script>
|
|
43
43
|
|
|
44
44
|
<template>
|
|
45
|
-
<CalendarRoot
|
|
46
|
-
v-slot='{ config }'
|
|
47
|
-
v-model:date='date'
|
|
48
|
-
v-model:select='select'
|
|
49
|
-
v-bind='props'
|
|
50
|
-
:class='$style.content'
|
|
51
|
-
@select='(select) => $emit("select", select)'
|
|
52
|
-
>
|
|
53
|
-
<section v-for='(calendar, ix) in calendars' :key='`calendar-${ix}`'>
|
|
54
|
-
<CalendarHeader
|
|
55
|
-
:with-prev='ix === 0'
|
|
56
|
-
:with-next='ix === calendars.length - 1'
|
|
57
|
-
:prev-disabled='nav.isPrevDisabled'
|
|
58
|
-
:next-disabled='nav.isNextDisabled'
|
|
45
|
+
<CalendarRoot
|
|
46
|
+
v-slot='{ config }'
|
|
47
|
+
v-model:date='date'
|
|
48
|
+
v-model:select='select'
|
|
49
|
+
v-bind='props'
|
|
50
|
+
:class='$style.content'
|
|
51
|
+
@select='(select) => $emit("select", select)'
|
|
52
|
+
>
|
|
53
|
+
<section v-for='(calendar, ix) in calendars' :key='`calendar-${ix}`'>
|
|
54
|
+
<CalendarHeader
|
|
55
|
+
:with-prev='ix === 0'
|
|
56
|
+
:with-next='ix === calendars.length - 1'
|
|
57
|
+
:prev-disabled='nav.isPrevDisabled'
|
|
58
|
+
:next-disabled='nav.isNextDisabled'
|
|
59
59
|
@prev='() => {
|
|
60
60
|
nav.move(-1);
|
|
61
61
|
$emit("prev");
|
|
62
|
-
}'
|
|
62
|
+
}'
|
|
63
63
|
@next='() => {
|
|
64
64
|
nav.move(1);
|
|
65
65
|
$emit("next");
|
|
66
|
-
}'
|
|
66
|
+
}'
|
|
67
67
|
@level='() => {
|
|
68
68
|
level = nav.nextLevel();
|
|
69
69
|
$emit("level");
|
|
70
|
-
}'
|
|
71
|
-
>
|
|
72
|
-
<slot name='level' :config>
|
|
73
|
-
{{ nav.getLevelLabel(calendar, config) }}
|
|
74
|
-
</slot>
|
|
75
|
-
</CalendarHeader>
|
|
76
|
-
|
|
77
|
-
<CalendarMonth
|
|
78
|
-
v-if='level === "month"'
|
|
79
|
-
:month='calendar'
|
|
80
|
-
:with-week-numbers='props.withWeekNumbers'
|
|
81
|
-
:with-cell-spacing='props.withCellSpacing'
|
|
82
|
-
:size
|
|
83
|
-
>
|
|
84
|
-
<template v-if='!!$slots.weekday' #weekday>
|
|
85
|
-
<slot name='weekday' />
|
|
86
|
-
</template>
|
|
87
|
-
|
|
88
|
-
<slot name='day' />
|
|
89
|
-
</CalendarMonth>
|
|
90
|
-
<CalendarYear
|
|
91
|
-
v-if='level === "year"'
|
|
92
|
-
:year='calendar'
|
|
93
|
-
:size
|
|
94
|
-
:selectable='props.minLevel === "year"'
|
|
70
|
+
}'
|
|
71
|
+
>
|
|
72
|
+
<slot name='level' :config>
|
|
73
|
+
{{ nav.getLevelLabel(calendar, config) }}
|
|
74
|
+
</slot>
|
|
75
|
+
</CalendarHeader>
|
|
76
|
+
|
|
77
|
+
<CalendarMonth
|
|
78
|
+
v-if='level === "month"'
|
|
79
|
+
:month='calendar'
|
|
80
|
+
:with-week-numbers='props.withWeekNumbers'
|
|
81
|
+
:with-cell-spacing='props.withCellSpacing'
|
|
82
|
+
:size
|
|
83
|
+
>
|
|
84
|
+
<template v-if='!!$slots.weekday' #weekday>
|
|
85
|
+
<slot name='weekday' />
|
|
86
|
+
</template>
|
|
87
|
+
|
|
88
|
+
<slot name='day' />
|
|
89
|
+
</CalendarMonth>
|
|
90
|
+
<CalendarYear
|
|
91
|
+
v-if='level === "year"'
|
|
92
|
+
:year='calendar'
|
|
93
|
+
:size
|
|
94
|
+
:selectable='props.minLevel === "year"'
|
|
95
95
|
@select='(month) => {
|
|
96
96
|
if (props.minLevel !== "year") {
|
|
97
97
|
level = nav.prevLevel();
|
|
98
98
|
date = month;
|
|
99
99
|
}
|
|
100
|
-
}'
|
|
101
|
-
/>
|
|
102
|
-
<CalendarDecade
|
|
103
|
-
v-if='level === "decade"'
|
|
104
|
-
:date='calendar'
|
|
105
|
-
:size
|
|
106
|
-
:selectable='props.minLevel === "decade"'
|
|
100
|
+
}'
|
|
101
|
+
/>
|
|
102
|
+
<CalendarDecade
|
|
103
|
+
v-if='level === "decade"'
|
|
104
|
+
:date='calendar'
|
|
105
|
+
:size
|
|
106
|
+
:selectable='props.minLevel === "decade"'
|
|
107
107
|
@select='(year) => {
|
|
108
108
|
if (props.minLevel !== "decade") {
|
|
109
109
|
level = nav.prevLevel();
|
|
110
110
|
date = year;
|
|
111
111
|
}
|
|
112
|
-
}'
|
|
113
|
-
/>
|
|
114
|
-
</section>
|
|
115
|
-
</CalendarRoot>
|
|
112
|
+
}'
|
|
113
|
+
/>
|
|
114
|
+
</section>
|
|
115
|
+
</CalendarRoot>
|
|
116
116
|
</template>
|
|
117
117
|
|
|
118
118
|
<style lang="postcss" module>
|
|
119
|
-
.content {
|
|
120
|
-
--calendar-cell-spacing: rem(1px);
|
|
121
|
-
|
|
122
|
-
display: flex;
|
|
123
|
-
gap: var(--spacing-sm);
|
|
124
|
-
|
|
125
|
-
width: fit-content;
|
|
126
|
-
}
|
|
119
|
+
.content {
|
|
120
|
+
--calendar-cell-spacing: rem(1px);
|
|
121
|
+
|
|
122
|
+
display: flex;
|
|
123
|
+
gap: var(--spacing-sm);
|
|
124
|
+
|
|
125
|
+
width: fit-content;
|
|
126
|
+
}
|
|
127
127
|
</style>
|