@esportsplus/ui 0.25.9 → 0.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/build/components/checkbox/index.d.ts +125 -5
  2. package/build/components/checkbox/index.js +12 -12
  3. package/build/components/input/index.d.ts +21 -15
  4. package/build/components/input/index.js +6 -16
  5. package/build/components/input/scss/index.scss +1 -1
  6. package/build/components/radio/index.d.ts +116 -6
  7. package/build/components/radio/index.js +2 -32
  8. package/build/components/range/index.d.ts +22 -15
  9. package/build/components/range/index.js +10 -20
  10. package/build/components/range/scss/index.scss +1 -1
  11. package/build/components/root/scss/index.scss +1 -1
  12. package/build/components/select/index.d.ts +24 -8
  13. package/build/components/select/index.js +34 -38
  14. package/build/components/select/scss/index.scss +1 -1
  15. package/build/components/switch/index.d.ts +116 -6
  16. package/build/components/switch/index.js +2 -32
  17. package/build/components/textarea/index.d.ts +21 -15
  18. package/build/components/textarea/index.js +9 -15
  19. package/build/components/textarea/scss/index.scss +1 -1
  20. package/build/css-utilities/flex/scss/index.scss +1 -1
  21. package/package.json +1 -1
  22. package/src/components/checkbox/index.ts +17 -18
  23. package/src/components/input/index.ts +10 -26
  24. package/src/components/input/scss/index.scss +13 -10
  25. package/src/components/input/scss/variables.scss +1 -1
  26. package/src/components/radio/index.ts +2 -42
  27. package/src/components/range/index.ts +16 -32
  28. package/src/components/range/scss/index.scss +26 -27
  29. package/src/components/range/scss/variables.scss +2 -0
  30. package/src/components/root/scss/variables.scss +1 -1
  31. package/src/components/select/index.ts +46 -46
  32. package/src/components/select/scss/index.scss +22 -13
  33. package/src/components/select/scss/variables.scss +39 -1
  34. package/src/components/switch/index.ts +2 -42
  35. package/src/components/textarea/index.ts +11 -21
  36. package/src/components/textarea/scss/index.scss +11 -8
  37. package/src/css-utilities/flex/scss/index.scss +7 -0
  38. package/src/css-utilities/flex/scss/variables.scss +39 -0
@@ -6,25 +6,21 @@ import template from '~/components/template';
6
6
  import './scss/index.scss';
7
7
 
8
8
 
9
- type A = Attributes & {
10
- 'textarea-tag'?: Attributes;
11
- state?: { active: boolean, error: string };
12
- };
9
+ type A = Attributes & { state?: { active: boolean, error: string } };
13
10
 
14
11
 
15
- const OMIT = ['textarea-tag'];
12
+ const OMIT = ['state'];
16
13
 
17
14
 
18
- export default template.factory(
19
- function(attributes: A, content) {
20
- let a = attributes['textarea-tag'],
21
- state = attributes.state || reactive({
15
+ export default template.factory<A, never>(
16
+ function(attributes) {
17
+ let state = attributes.state || reactive({
22
18
  active: false,
23
19
  error: ''
24
20
  });
25
21
 
26
22
  return html`
27
- <label
23
+ <textarea
28
24
  class='textarea'
29
25
  ${{
30
26
  class: () => state.active && '--active',
@@ -33,19 +29,13 @@ export default template.factory(
33
29
  },
34
30
  onfocusout: () => {
35
31
  state.active = false;
36
- }
32
+ },
33
+ onrender: form.input.onrender(state)
37
34
  }}
38
- ${a ? omit(attributes, OMIT) : attributes}
35
+ ${omit(attributes, OMIT)}
39
36
  >
40
- <textarea
41
- class='textarea-tag'
42
- onrender=${form.input.onrender(state)}
43
- ${a}
44
- >
45
- ${a?.value as string}
46
- </textarea>
47
- ${content}
48
- </label>
37
+ ${attributes?.value as string}
38
+ </textarea>
49
39
  `;
50
40
  }
51
41
  );
@@ -3,24 +3,27 @@
3
3
  background: var(--background);
4
4
  border: var(--border-width) var(--border-style) var(--border-color);
5
5
  border-radius: var(--border-radius);
6
+ color: var(--color);
6
7
  cursor: text;
7
8
  display: flex;
9
+ flex: 1 1 auto;
8
10
  flex-wrap: wrap;
9
11
  font-size: var(--font-size);
10
12
  line-height: var(--line-height);
13
+ min-width: 0;
14
+ padding: var(--padding-vertical) var(--padding-horizontal);
11
15
  position: relative;
16
+ transition:
17
+ background var(--transition-duration) ease-in-out,
18
+ border-color var(--transition-duration) ease-in-out,
19
+ box-shadow var(--transition-duration) ease-in-out,
20
+ opacity var(--transition-duration) ease-in-out,
21
+ transform var(--transition-duration) ease-in-out;
22
+ white-space: normal;
12
23
  width: 100%;
13
24
 
14
25
  &:invalid,
15
26
  &:required {
16
27
  box-shadow: none;
17
28
  }
18
-
19
- &-tag {
20
- color: var(--color);
21
- flex: 1 1 auto;
22
- padding: var(--padding-vertical) var(--padding-horizontal);
23
- min-width: 0;
24
- white-space: normal;
25
- }
26
29
  }
@@ -1,3 +1,5 @@
1
+ @use 'variables';
2
+
1
3
  .--flex {
2
4
  &-center {
3
5
  align-content: center;
@@ -28,6 +30,11 @@
28
30
  flex: 0 0 var(--width);
29
31
  }
30
32
 
33
+ &-gap {
34
+ display: flex;
35
+ gap: var(--gap-vertical) var(--gap-horizontal);
36
+ }
37
+
31
38
  &-horizontal {
32
39
  display: flex;
33
40
  flex-flow: row wrap;
@@ -0,0 +1,39 @@
1
+ @use '/lib';
2
+ @use '/tokens';
3
+
4
+ .--flex-gap {
5
+ @each $direction in 'horizontal' 'vertical' {
6
+ &,
7
+ &-#{$direction} {
8
+ @each $key in lib.map-keys(tokens.$border-width) {
9
+ &-border-width {
10
+ --gap-#{$direction}: var(--border-width-400);
11
+
12
+ &-#{$key} {
13
+ --gap-#{$direction}: var(--border-width-#{$key});
14
+ }
15
+ }
16
+ }
17
+
18
+ @each $key in lib.map-keys(tokens.$spacer) {
19
+ &-spacer {
20
+ --gap-#{$direction}: var(--spacer-400);
21
+
22
+ &-#{$key} {
23
+ --gap-#{$direction}: var(--spacer-#{$key});
24
+ }
25
+ }
26
+ }
27
+
28
+ @each $key in lib.map-keys(tokens.$size) {
29
+ &-#{$key} {
30
+ --gap-#{$direction}: var(--size-#{$key});
31
+ }
32
+ }
33
+
34
+ &-inherit {
35
+ --gap-#{$direction}: inherit;
36
+ }
37
+ }
38
+ }
39
+ }