yuyeon 0.0.22 → 0.0.24

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 (30) hide show
  1. package/dist/style.css +1 -1
  2. package/dist/yuyeon.js +638 -601
  3. package/dist/yuyeon.umd.cjs +3 -3
  4. package/lib/components/button/YButton.mjs +4 -4
  5. package/lib/components/button/YButton.mjs.map +1 -1
  6. package/lib/components/card/YCard.scss +36 -36
  7. package/lib/components/checkbox/YInputCheckbox.scss +86 -86
  8. package/lib/components/field-input/YFieldInput.mjs +2 -1
  9. package/lib/components/field-input/YFieldInput.mjs.map +1 -1
  10. package/lib/components/field-input/YFieldInput.scss +11 -1
  11. package/lib/components/icons/YIconCheckbox.scss +1 -1
  12. package/lib/components/input/YInput.mjs +15 -7
  13. package/lib/components/input/YInput.mjs.map +1 -1
  14. package/lib/components/input/YInput.scss +256 -245
  15. package/lib/components/layer/YLayer.scss +33 -33
  16. package/lib/components/menu/YMenu.scss +22 -22
  17. package/lib/components/panel/YDividePanel.scss +2 -2
  18. package/lib/components/progress-bar/YProgressBar.mjs +1 -1
  19. package/lib/components/progress-bar/YProgressBar.mjs.map +1 -1
  20. package/lib/components/switch/YSwitch.scss +198 -198
  21. package/lib/components/table/YTable.scss +114 -114
  22. package/lib/components/tree-view/YTreeView.mjs +1 -1
  23. package/lib/components/tree-view/YTreeView.mjs.map +1 -1
  24. package/lib/composables/theme/factory.mjs +4 -2
  25. package/lib/composables/theme/factory.mjs.map +1 -1
  26. package/lib/styles/base.scss +6 -2
  27. package/package.json +1 -1
  28. package/types/components/field-input/YFieldInput.d.ts +27 -0
  29. package/types/components/input/YInput.d.ts +30 -3
  30. package/types/components/select/YSelect.d.ts +27 -0
@@ -1,33 +1,33 @@
1
- .y-layer-group {
2
- contain: layout;
3
- left: 0;
4
- top: 0;
5
- pointer-events: none;
6
- position: absolute;
7
- display: contents;
8
- }
9
-
10
- .y-layer {
11
- border-radius: inherit;
12
- display: flex;
13
- inset: 0;
14
- position: fixed;
15
- color: rgba(var(--y-theme-on-background), 1);
16
-
17
- &__scrim {
18
- pointer-events: auto;
19
- background: rgb(var(--y-layer-scrim, 0, 0, 0));
20
- border-radius: inherit;
21
- inset: 0;
22
- opacity: 0.4;
23
- position: fixed;
24
- }
25
-
26
- &__content {
27
- outline: none;
28
- position: absolute;
29
- pointer-events: auto;
30
- contain: layout;
31
- transform-style: preserve-3d;
32
- }
33
- }
1
+ .y-layer-group {
2
+ contain: layout;
3
+ left: 0;
4
+ top: 0;
5
+ pointer-events: none;
6
+ position: absolute;
7
+ display: contents;
8
+ }
9
+
10
+ .y-layer {
11
+ border-radius: inherit;
12
+ display: flex;
13
+ inset: 0;
14
+ position: fixed;
15
+ color: var(--y-theme-on-background);
16
+
17
+ &__scrim {
18
+ pointer-events: auto;
19
+ background: rgb(var(--y-layer-scrim, 0, 0, 0));
20
+ border-radius: inherit;
21
+ inset: 0;
22
+ opacity: 0.4;
23
+ position: fixed;
24
+ }
25
+
26
+ &__content {
27
+ outline: none;
28
+ position: absolute;
29
+ pointer-events: auto;
30
+ contain: layout;
31
+ transform-style: preserve-3d;
32
+ }
33
+ }
@@ -1,22 +1,22 @@
1
- .y-menu {
2
- font-size: 0.875rem;
3
- $elevation-fallback: 1px 1px 8px -1px rgba(0, 0, 0, 0.14), 4px 4px 24px -4px rgba(0, 0, 0, 0.28), -2px -2px 8px -2px rgba(0, 0, 0, 0.14);
4
-
5
- --y-menu__border-radius: 8px;
6
- --y-menu__elevation: var(--y-elevation--level2);
7
-
8
- &__content {
9
- box-shadow: var(--y-menu__elevation, #{$elevation-fallback});
10
- border-radius: var(--y-menu__border-radius);
11
- background: rgba(var(--y-theme-surface), 1);
12
- display: flex;
13
- flex-direction: column;
14
-
15
- > .y-card {
16
- background: rgb(var(--y-theme-surface));
17
- border-radius: inherit;
18
- overflow: auto;
19
- height: 100%;
20
- }
21
- }
22
- }
1
+ .y-menu {
2
+ font-size: 0.875rem;
3
+ $elevation-fallback: 1px 1px 8px -1px rgba(0, 0, 0, 0.14), 4px 4px 24px -4px rgba(0, 0, 0, 0.28), -2px -2px 8px -2px rgba(0, 0, 0, 0.14);
4
+
5
+ --y-menu__border-radius: 8px;
6
+ --y-menu__elevation: var(--y-elevation--level2);
7
+
8
+ &__content {
9
+ box-shadow: var(--y-menu__elevation, #{$elevation-fallback});
10
+ border-radius: var(--y-menu__border-radius);
11
+ background: var(--y-theme-surface);
12
+ display: flex;
13
+ flex-direction: column;
14
+
15
+ > .y-card {
16
+ background: rgb(var(--y-theme-surface));
17
+ border-radius: inherit;
18
+ overflow: auto;
19
+ height: 100%;
20
+ }
21
+ }
22
+ }
@@ -30,14 +30,14 @@ $side-padding: 16px !default;
30
30
  }
31
31
 
32
32
  &:hover &-line {
33
- background: rgba(var(--y-theme-primary), 1);
33
+ background: var(--y-theme-primary);
34
34
  }
35
35
  }
36
36
 
37
37
  &--resizing &__divider {
38
38
  background: rgba(var(--y-theme-primary), 0.12);
39
39
  &-line {
40
- background: rgba(var(--y-theme-primary), 1);
40
+ background: var(--y-theme-primary);
41
41
  }
42
42
  }
43
43
  }
@@ -67,7 +67,7 @@ export const YProgressBar = defineComponent({
67
67
  leadColor() {
68
68
  let color = this.color ?? '';
69
69
  if (!isColorValue(color)) {
70
- color = `rgba(var(--y-theme-${color}), 1)`;
70
+ color = `var(--y-theme-${color})`;
71
71
  }
72
72
  return color;
73
73
  },
@@ -1 +1 @@
1
- {"version":3,"file":"YProgressBar.mjs","names":["defineComponent","useProgress","isColorValue","YProgressBar","name","props","value","type","Number","rounded","Boolean","height","noRewindTransition","outlined","innerText","color","String","default","textColor","outlineColor","indeterminate","reverse","setup","numValue","data","delta","computed","classes","noTransition","leadColor","styles","minWidth","transform","render","slots","$slots","_createVNode","undefined","_createTextVNode"],"sources":["../../../src/components/progress-bar/YProgressBar.tsx"],"sourcesContent":["import { PropType, StyleValue, defineComponent } from 'vue';\n\nimport { useProgress } from '../../composables/progress';\nimport './YProgressBar.scss';\nimport { isColorValue } from \"../../util/color\";\n\nexport const YProgressBar = defineComponent({\n name: 'YProgressBar',\n props: {\n value: {\n type: Number as PropType<number>,\n },\n rounded: {\n type: Boolean as PropType<boolean>,\n },\n height: {\n type: Number as PropType<number>,\n },\n noRewindTransition: {\n type: Boolean as PropType<boolean>,\n },\n outlined: {\n type: Boolean as PropType<boolean>,\n },\n innerText: {\n type: Boolean as PropType<boolean>,\n },\n color: {\n type: String as PropType<string>,\n default: 'primary',\n },\n textColor: {\n type: String as PropType<string>,\n },\n outlineColor: {\n type: String as PropType<string>,\n },\n indeterminate: Boolean,\n reverse: Boolean,\n },\n setup(props) {\n const { numValue } = useProgress(props);\n\n return {\n numValue,\n };\n },\n data() {\n return {\n delta: 0,\n };\n },\n computed: {\n classes(): Record<string, boolean> {\n let noTransition = false;\n if (this.noRewindTransition && this.delta < 0) {\n noTransition = true;\n }\n return {\n 'y-progress--no-trans': noTransition,\n 'y-progress--outlined': !!this.outlined,\n 'y-progress--indeterminate': !!this.indeterminate,\n 'y-progress-bar--rounded': !!this.rounded,\n 'y-progress-bar--reverse': !!this.reverse,\n };\n },\n leadColor(): string {\n let color = this.color ?? '';\n if (!isColorValue(color)) {\n color = `rgba(var(--y-theme-${color}), 1)`;\n }\n return color;\n },\n styles(): StyleValue {\n let minWidth;\n if (this.innerText && this.numValue < 5 && this.numValue > 0) {\n minWidth = '2rem';\n }\n return {\n transform: `scaleX(${this.numValue / 100})`,\n minWidth,\n };\n },\n },\n render() {\n const {\n classes,\n numValue,\n height,\n outlineColor,\n textColor,\n styles,\n innerText,\n } = this;\n const slots = this.$slots;\n return (\n <div\n class={{ 'y-progress y-progress-bar': true, ...classes }}\n role=\"progressbar\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n aria-valuenow={numValue}\n style={{\n '--y-progress-bar__height':\n height !== undefined ? `${height}px` : undefined,\n '--y-progress-bar__outline-color':\n outlineColor !== undefined ? outlineColor : undefined,\n '--y-progress-bar__color': this.leadColor,\n }}\n >\n <div class=\"y-progress__track\"></div>\n <div class=\"y-progress__tube\">\n <div class=\"y-progress__lead\" style={styles}>\n {slots['lead-inner']\n ? slots['lead-inner']()\n : innerText && (\n <div\n class={{\n 'y-progress__lead-inner': true,\n 'y-progress__lead-inner--fixed': numValue < 3,\n }}\n style={{ color: textColor }}\n >\n <span>{numValue} %</span>\n </div>\n )}\n </div>\n </div>\n </div>\n );\n },\n});\n"],"mappings":";AAAA,SAA+BA,eAAe,QAAQ,KAAK;AAAC,SAEnDC,WAAW;AACpB;AAA6B,SACpBC,YAAY;AAErB,OAAO,MAAMC,YAAY,GAAGH,eAAe,CAAC;EAC1CI,IAAI,EAAE,cAAc;EACpBC,KAAK,EAAE;IACLC,KAAK,EAAE;MACLC,IAAI,EAAEC;IACR,CAAC;IACDC,OAAO,EAAE;MACPF,IAAI,EAAEG;IACR,CAAC;IACDC,MAAM,EAAE;MACNJ,IAAI,EAAEC;IACR,CAAC;IACDI,kBAAkB,EAAE;MAClBL,IAAI,EAAEG;IACR,CAAC;IACDG,QAAQ,EAAE;MACRN,IAAI,EAAEG;IACR,CAAC;IACDI,SAAS,EAAE;MACTP,IAAI,EAAEG;IACR,CAAC;IACDK,KAAK,EAAE;MACLR,IAAI,EAAES,MAA0B;MAChCC,OAAO,EAAE;IACX,CAAC;IACDC,SAAS,EAAE;MACTX,IAAI,EAAES;IACR,CAAC;IACDG,YAAY,EAAE;MACZZ,IAAI,EAAES;IACR,CAAC;IACDI,aAAa,EAAEV,OAAO;IACtBW,OAAO,EAAEX;EACX,CAAC;EACDY,KAAKA,CAACjB,KAAK,EAAE;IACX,MAAM;MAAEkB;IAAS,CAAC,GAAGtB,WAAW,CAACI,KAAK,CAAC;IAEvC,OAAO;MACLkB;IACF,CAAC;EACH,CAAC;EACDC,IAAIA,CAAA,EAAG;IACL,OAAO;MACLC,KAAK,EAAE;IACT,CAAC;EACH,CAAC;EACDC,QAAQ,EAAE;IACRC,OAAOA,CAAA,EAA4B;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AA,iBACJJ,QAAQ;MAAA,SAChB;QACL,0BAA0B,EACxBZ,MAAM,KAAK0B,SAAS,GAAI,GAAE1B,MAAO,IAAG,GAAG0B,SAAS;QAClD,iCAAiC,EAC/BlB,YAAY,KAAKkB,SAAS,GAAGlB,YAAY,GAAGkB,SAAS;QACvD,yBAAyB,EAAE,IAAI,CAACR;MAClC;IAAC,IAAAO,YAAA;MAAA,SAEU;IAAmB,UAAAA,YAAA;MAAA,SACnB;IAAkB,IAAAA,YAAA;MAAA,SAChB,kBAAkB;MAAA,SAAQN;IAAM,IACxCI,KAAK,CAAC,YAAY,CAAC,GAChBA,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,GACrBpB,SAAS,IAAAsB,YAAA;MAAA,SAEE;QACL,wBAAwB,EAAE,IAAI;QAC9B,+BAA+B,EAAEb,QAAQ,GAAG;MAC9C,CAAC;MAAA,SACM;QAAER,KAAK,EAAEG;MAAU;IAAC,IAAAkB,YAAA,gBAEpBb,QAAQ,EAAAe,gBAAA,UAElB;EAKf;AACF,CAAC,CAAC"}
1
+ {"version":3,"file":"YProgressBar.mjs","names":["defineComponent","useProgress","isColorValue","YProgressBar","name","props","value","type","Number","rounded","Boolean","height","noRewindTransition","outlined","innerText","color","String","default","textColor","outlineColor","indeterminate","reverse","setup","numValue","data","delta","computed","classes","noTransition","leadColor","styles","minWidth","transform","render","slots","$slots","_createVNode","undefined","_createTextVNode"],"sources":["../../../src/components/progress-bar/YProgressBar.tsx"],"sourcesContent":["import { PropType, StyleValue, defineComponent } from 'vue';\r\n\r\nimport { useProgress } from '../../composables/progress';\r\nimport './YProgressBar.scss';\r\nimport { isColorValue } from \"../../util/color\";\r\n\r\nexport const YProgressBar = defineComponent({\r\n name: 'YProgressBar',\r\n props: {\r\n value: {\r\n type: Number as PropType<number>,\r\n },\r\n rounded: {\r\n type: Boolean as PropType<boolean>,\r\n },\r\n height: {\r\n type: Number as PropType<number>,\r\n },\r\n noRewindTransition: {\r\n type: Boolean as PropType<boolean>,\r\n },\r\n outlined: {\r\n type: Boolean as PropType<boolean>,\r\n },\r\n innerText: {\r\n type: Boolean as PropType<boolean>,\r\n },\r\n color: {\r\n type: String as PropType<string>,\r\n default: 'primary',\r\n },\r\n textColor: {\r\n type: String as PropType<string>,\r\n },\r\n outlineColor: {\r\n type: String as PropType<string>,\r\n },\r\n indeterminate: Boolean,\r\n reverse: Boolean,\r\n },\r\n setup(props) {\r\n const { numValue } = useProgress(props);\r\n\r\n return {\r\n numValue,\r\n };\r\n },\r\n data() {\r\n return {\r\n delta: 0,\r\n };\r\n },\r\n computed: {\r\n classes(): Record<string, boolean> {\r\n let noTransition = false;\r\n if (this.noRewindTransition && this.delta < 0) {\r\n noTransition = true;\r\n }\r\n return {\r\n 'y-progress--no-trans': noTransition,\r\n 'y-progress--outlined': !!this.outlined,\r\n 'y-progress--indeterminate': !!this.indeterminate,\r\n 'y-progress-bar--rounded': !!this.rounded,\r\n 'y-progress-bar--reverse': !!this.reverse,\r\n };\r\n },\r\n leadColor(): string {\r\n let color = this.color ?? '';\r\n if (!isColorValue(color)) {\r\n color = `var(--y-theme-${color})`;\r\n }\r\n return color;\r\n },\r\n styles(): StyleValue {\r\n let minWidth;\r\n if (this.innerText && this.numValue < 5 && this.numValue > 0) {\r\n minWidth = '2rem';\r\n }\r\n return {\r\n transform: `scaleX(${this.numValue / 100})`,\r\n minWidth,\r\n };\r\n },\r\n },\r\n render() {\r\n const {\r\n classes,\r\n numValue,\r\n height,\r\n outlineColor,\r\n textColor,\r\n styles,\r\n innerText,\r\n } = this;\r\n const slots = this.$slots;\r\n return (\r\n <div\r\n class={{ 'y-progress y-progress-bar': true, ...classes }}\r\n role=\"progressbar\"\r\n aria-valuemin=\"0\"\r\n aria-valuemax=\"100\"\r\n aria-valuenow={numValue}\r\n style={{\r\n '--y-progress-bar__height':\r\n height !== undefined ? `${height}px` : undefined,\r\n '--y-progress-bar__outline-color':\r\n outlineColor !== undefined ? outlineColor : undefined,\r\n '--y-progress-bar__color': this.leadColor,\r\n }}\r\n >\r\n <div class=\"y-progress__track\"></div>\r\n <div class=\"y-progress__tube\">\r\n <div class=\"y-progress__lead\" style={styles}>\r\n {slots['lead-inner']\r\n ? slots['lead-inner']()\r\n : innerText && (\r\n <div\r\n class={{\r\n 'y-progress__lead-inner': true,\r\n 'y-progress__lead-inner--fixed': numValue < 3,\r\n }}\r\n style={{ color: textColor }}\r\n >\r\n <span>{numValue} %</span>\r\n </div>\r\n )}\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n },\r\n});\r\n"],"mappings":";AAAA,SAA+BA,eAAe,QAAQ,KAAK;AAAC,SAEnDC,WAAW;AACpB;AAA6B,SACpBC,YAAY;AAErB,OAAO,MAAMC,YAAY,GAAGH,eAAe,CAAC;EAC1CI,IAAI,EAAE,cAAc;EACpBC,KAAK,EAAE;IACLC,KAAK,EAAE;MACLC,IAAI,EAAEC;IACR,CAAC;IACDC,OAAO,EAAE;MACPF,IAAI,EAAEG;IACR,CAAC;IACDC,MAAM,EAAE;MACNJ,IAAI,EAAEC;IACR,CAAC;IACDI,kBAAkB,EAAE;MAClBL,IAAI,EAAEG;IACR,CAAC;IACDG,QAAQ,EAAE;MACRN,IAAI,EAAEG;IACR,CAAC;IACDI,SAAS,EAAE;MACTP,IAAI,EAAEG;IACR,CAAC;IACDK,KAAK,EAAE;MACLR,IAAI,EAAES,MAA0B;MAChCC,OAAO,EAAE;IACX,CAAC;IACDC,SAAS,EAAE;MACTX,IAAI,EAAES;IACR,CAAC;IACDG,YAAY,EAAE;MACZZ,IAAI,EAAES;IACR,CAAC;IACDI,aAAa,EAAEV,OAAO;IACtBW,OAAO,EAAEX;EACX,CAAC;EACDY,KAAKA,CAACjB,KAAK,EAAE;IACX,MAAM;MAAEkB;IAAS,CAAC,GAAGtB,WAAW,CAACI,KAAK,CAAC;IAEvC,OAAO;MACLkB;IACF,CAAC;EACH,CAAC;EACDC,IAAIA,CAAA,EAAG;IACL,OAAO;MACLC,KAAK,EAAE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Q,CAAC;MAAA,QACnD,aAAa;MAAA,iBACJ,GAAG;MAAA,iBACH,KAAK;MAAA,iBACJJ,QAAQ;MAAA,SAChB;QACL,0BAA0B,EACxBZ,MAAM,KAAK0B,SAAS,GAAI,GAAE1B,MAAO,IAAG,GAAG0B,SAAS;QAClD,iCAAiC,EAC/BlB,YAAY,KAAKkB,SAAS,GAAGlB,YAAY,GAAGkB,SAAS;QACvD,yBAAyB,EAAE,IAAI,CAACR;MAClC;IAAC,IAAAO,YAAA;MAAA,SAEU;IAAmB,UAAAA,YAAA;MAAA,SACnB;IAAkB,IAAAA,YAAA;MAAA,SAChB,kBAAkB;MAAA,SAAQN;IAAM,IACxCI,KAAK,CAAC,YAAY,CAAC,GAChBA,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,GACrBpB,SAAS,IAAAsB,YAAA;MAAA,SAEE;QACL,wBAAwB,EAAE,IAAI;QAC9B,+BAA+B,EAAEb,QAAQ,GAAG;MAC9C,CAAC;MAAA,SACM;QAAER,KAAK,EAAEG;MAAU;IAAC,IAAAkB,YAAA,gBAEpBb,QAAQ,EAAAe,gBAAA,UAElB;EAKf;AACF,CAAC,CAAC"}
@@ -1,198 +1,198 @@
1
- @use '../../styles/palette';
2
- @use '../../styles/variables';
3
-
4
- .y-switch {
5
- --y-switch__color: rgba(var(--y-theme-primary), 1);
6
- font-size: 1rem;
7
-
8
- &__slot {
9
- display: flex;
10
- cursor: pointer;
11
- align-items: center;
12
- color: inherit;
13
- min-height: inherit;
14
- position: relative;
15
- }
16
-
17
- &__input {
18
- width: 3em;
19
- height: 1.5em;
20
- position: relative;
21
- display: inline-flex;
22
- user-select: none;
23
- color: inherit;
24
- flex: 0 0 auto;
25
-
26
- input[role='switch'] {
27
- position: absolute;
28
- opacity: 0;
29
- width: 100%;
30
- height: 100%;
31
- cursor: pointer;
32
- user-select: none;
33
- }
34
- }
35
- &:not(&--loading) &__input:active &__thumb {
36
- width: 1em;
37
- }
38
-
39
- &__track {
40
- width: 100%;
41
- height: 100%;
42
- border-radius: 2em;
43
- background-color: #e0e0e0;
44
- position: absolute;
45
- left: 0;
46
- top: 0;
47
- transition: 300ms;
48
- }
49
-
50
- &__thumb {
51
- width: 1.1em;
52
- height: 1.1em;
53
- align-self: center;
54
- left: 0.185em;
55
- border-radius: 50%;
56
- display: flex;
57
- justify-content: center;
58
- align-items: center;
59
- background-color: #fff;
60
- pointer-events: none;
61
- position: relative;
62
- transition: 180ms cubic-bezier(0.78, 0.04, 0.9, 0.18);
63
- will-change: left, transform;
64
- }
65
-
66
- &__spinner {
67
- position: relative;
68
- width: 100%;
69
- height: 100%;
70
- border-radius: 50%;
71
- animation: rotate 2s linear infinite;
72
- contain: paint;
73
-
74
- @keyframes spinner-blur {
75
- 0% {
76
- filter: blur(4px);
77
- }
78
- 50% {
79
- filter: blur(1px);
80
- }
81
- 100% {
82
- filter: blur(4px);
83
- }
84
- }
85
-
86
- &:before {
87
- content: '';
88
- position: absolute;
89
- top: 2px;
90
- left: 2px;
91
- right: 2px;
92
- bottom: 2px;
93
- border-radius: 50%;
94
- border-width: 2px 2px 0 0;
95
- border-style: solid;
96
- border-color: var(--y-switch__color) transparent;
97
- }
98
-
99
- &:after {
100
- content: '';
101
- position: absolute;
102
- left: 0;
103
- top: 0;
104
- right: 0;
105
- bottom: 0;
106
- background: linear-gradient(0deg, transparent 60%, rgba(var(--y-switch__color), 0.4));
107
- filter: blur(4px);
108
- animation: spinner-blur 3s infinite;
109
- }
110
- }
111
-
112
- &--active {
113
- .y-switch__track {
114
- background-color: var(--y-switch__color);
115
- }
116
-
117
- .y-switch__thumb {
118
- left: calc(100% - 1.1em - 0.24em);
119
- }
120
- }
121
-
122
- &--active:not(&--loading):active &__thumb {
123
- left: 1.8em;
124
- }
125
-
126
- &--focused {
127
- .y-switch__thumb:before {
128
- content: '';
129
- position: absolute;
130
- top: 2px;
131
- bottom: 2px;
132
- left: 2px;
133
- right: 2px;
134
- border-radius: 50%;
135
- background-color: rgba(var(--y-switch__color), 0.4);
136
- }
137
- }
138
-
139
- &--stick-out {
140
- .y-switch__thumb {
141
- box-shadow: 2px 2px 5px -2px rgba(0, 0, 0, 0.54), 1px 1px 4px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.08);
142
- }
143
-
144
- .y-switch__track {
145
- width: 80%;
146
- height: 74%;
147
- top: 50%;
148
- left: 50%;
149
- transform: translate(-50%, -50%);
150
- box-shadow: inset 0 0 4px -1px rgba(0, 0, 0, 0.34);
151
- }
152
- }
153
-
154
- &--disabled {
155
- opacity: 0.8;
156
- filter: brightness(0.88);
157
-
158
- .y-switch__thumb {
159
- opacity: 0.4;
160
- }
161
- }
162
- &--disabled &__slot,
163
- &--disabled &__input input {
164
- cursor: default;
165
- }
166
-
167
- &__state {
168
- position: relative;
169
- width: 100%;
170
- height: 100%;
171
- contain: content;
172
- }
173
-
174
- &__state-label {
175
- font-size: 12px;
176
- color: #ffffff;
177
- position: absolute;
178
- height: 100%;
179
- display: flex;
180
- align-items: center;
181
- transition: transform 180ms cubic-bezier(0.16, 0.85, 0.36, 0.96);
182
-
183
- &--on {
184
- left: -40px;
185
- }
186
- &--off {
187
- right: 10px;
188
- }
189
- }
190
-
191
- &--active &__state-label {
192
- transform: translateX(50px);
193
- }
194
-
195
- &--stick-out &__state-label--off {
196
- right: 7px;
197
- }
198
- }
1
+ @use '../../styles/palette';
2
+ @use '../../styles/variables';
3
+
4
+ .y-switch {
5
+ --y-switch__color: var(--y-theme-primary);
6
+ font-size: 1rem;
7
+
8
+ &__slot {
9
+ display: flex;
10
+ cursor: pointer;
11
+ align-items: center;
12
+ color: inherit;
13
+ min-height: inherit;
14
+ position: relative;
15
+ }
16
+
17
+ &__input {
18
+ width: 3em;
19
+ height: 1.5em;
20
+ position: relative;
21
+ display: inline-flex;
22
+ user-select: none;
23
+ color: inherit;
24
+ flex: 0 0 auto;
25
+
26
+ input[role='switch'] {
27
+ position: absolute;
28
+ opacity: 0;
29
+ width: 100%;
30
+ height: 100%;
31
+ cursor: pointer;
32
+ user-select: none;
33
+ }
34
+ }
35
+ &:not(&--loading) &__input:active &__thumb {
36
+ width: 1em;
37
+ }
38
+
39
+ &__track {
40
+ width: 100%;
41
+ height: 100%;
42
+ border-radius: 2em;
43
+ background-color: #e0e0e0;
44
+ position: absolute;
45
+ left: 0;
46
+ top: 0;
47
+ transition: 300ms;
48
+ }
49
+
50
+ &__thumb {
51
+ width: 1.1em;
52
+ height: 1.1em;
53
+ align-self: center;
54
+ left: 0.185em;
55
+ border-radius: 50%;
56
+ display: flex;
57
+ justify-content: center;
58
+ align-items: center;
59
+ background-color: #fff;
60
+ pointer-events: none;
61
+ position: relative;
62
+ transition: 180ms cubic-bezier(0.78, 0.04, 0.9, 0.18);
63
+ will-change: left, transform;
64
+ }
65
+
66
+ &__spinner {
67
+ position: relative;
68
+ width: 100%;
69
+ height: 100%;
70
+ border-radius: 50%;
71
+ animation: rotate 2s linear infinite;
72
+ contain: paint;
73
+
74
+ @keyframes spinner-blur {
75
+ 0% {
76
+ filter: blur(4px);
77
+ }
78
+ 50% {
79
+ filter: blur(1px);
80
+ }
81
+ 100% {
82
+ filter: blur(4px);
83
+ }
84
+ }
85
+
86
+ &:before {
87
+ content: '';
88
+ position: absolute;
89
+ top: 2px;
90
+ left: 2px;
91
+ right: 2px;
92
+ bottom: 2px;
93
+ border-radius: 50%;
94
+ border-width: 2px 2px 0 0;
95
+ border-style: solid;
96
+ border-color: var(--y-switch__color) transparent;
97
+ }
98
+
99
+ &:after {
100
+ content: '';
101
+ position: absolute;
102
+ left: 0;
103
+ top: 0;
104
+ right: 0;
105
+ bottom: 0;
106
+ background: linear-gradient(0deg, transparent 60%, rgba(var(--y-switch__color), 0.4));
107
+ filter: blur(4px);
108
+ animation: spinner-blur 3s infinite;
109
+ }
110
+ }
111
+
112
+ &--active {
113
+ .y-switch__track {
114
+ background-color: var(--y-switch__color);
115
+ }
116
+
117
+ .y-switch__thumb {
118
+ left: calc(100% - 1.1em - 0.24em);
119
+ }
120
+ }
121
+
122
+ &--active:not(&--loading):active &__thumb {
123
+ left: 1.8em;
124
+ }
125
+
126
+ &--focused {
127
+ .y-switch__thumb:before {
128
+ content: '';
129
+ position: absolute;
130
+ top: 2px;
131
+ bottom: 2px;
132
+ left: 2px;
133
+ right: 2px;
134
+ border-radius: 50%;
135
+ background-color: rgba(var(--y-switch__color), 0.4);
136
+ }
137
+ }
138
+
139
+ &--stick-out {
140
+ .y-switch__thumb {
141
+ box-shadow: 2px 2px 5px -2px rgba(0, 0, 0, 0.54), 1px 1px 4px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.08);
142
+ }
143
+
144
+ .y-switch__track {
145
+ width: 80%;
146
+ height: 74%;
147
+ top: 50%;
148
+ left: 50%;
149
+ transform: translate(-50%, -50%);
150
+ box-shadow: inset 0 0 4px -1px rgba(0, 0, 0, 0.34);
151
+ }
152
+ }
153
+
154
+ &--disabled {
155
+ opacity: 0.8;
156
+ filter: brightness(0.88);
157
+
158
+ .y-switch__thumb {
159
+ opacity: 0.4;
160
+ }
161
+ }
162
+ &--disabled &__slot,
163
+ &--disabled &__input input {
164
+ cursor: default;
165
+ }
166
+
167
+ &__state {
168
+ position: relative;
169
+ width: 100%;
170
+ height: 100%;
171
+ contain: content;
172
+ }
173
+
174
+ &__state-label {
175
+ font-size: 12px;
176
+ color: #ffffff;
177
+ position: absolute;
178
+ height: 100%;
179
+ display: flex;
180
+ align-items: center;
181
+ transition: transform 180ms cubic-bezier(0.16, 0.85, 0.36, 0.96);
182
+
183
+ &--on {
184
+ left: -40px;
185
+ }
186
+ &--off {
187
+ right: 10px;
188
+ }
189
+ }
190
+
191
+ &--active &__state-label {
192
+ transform: translateX(50px);
193
+ }
194
+
195
+ &--stick-out &__state-label--off {
196
+ right: 7px;
197
+ }
198
+ }