@anker-in/headless-ui 0.0.24 → 0.0.26

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 (47) hide show
  1. package/CONTRIBUTING.md +2 -2
  2. package/dist/cjs/components/button.js +1 -1
  3. package/dist/cjs/components/button.js.map +2 -2
  4. package/dist/cjs/components/heading.d.ts +2 -2
  5. package/dist/cjs/components/heading.js +1 -1
  6. package/dist/cjs/components/heading.js.map +3 -3
  7. package/dist/cjs/components/text.d.ts +3 -2
  8. package/dist/cjs/components/text.js +1 -1
  9. package/dist/cjs/components/text.js.map +3 -3
  10. package/dist/cjs/icons/spinner.js +1 -1
  11. package/dist/cjs/icons/spinner.js.map +2 -2
  12. package/dist/cjs/stories/button.stories.js +1 -1
  13. package/dist/cjs/stories/button.stories.js.map +2 -2
  14. package/dist/cjs/stories/heading.stories.d.ts +2 -2
  15. package/dist/cjs/stories/heading.stories.js +1 -1
  16. package/dist/cjs/stories/heading.stories.js.map +2 -2
  17. package/dist/cjs/stories/text.stories.d.ts +12 -3
  18. package/dist/cjs/stories/text.stories.js +1 -1
  19. package/dist/cjs/stories/text.stories.js.map +3 -3
  20. package/dist/esm/components/button.js +1 -1
  21. package/dist/esm/components/button.js.map +2 -2
  22. package/dist/esm/components/heading.d.ts +2 -2
  23. package/dist/esm/components/heading.js +1 -1
  24. package/dist/esm/components/heading.js.map +3 -3
  25. package/dist/esm/components/text.d.ts +3 -2
  26. package/dist/esm/components/text.js +1 -1
  27. package/dist/esm/components/text.js.map +3 -3
  28. package/dist/esm/icons/spinner.js +1 -1
  29. package/dist/esm/icons/spinner.js.map +2 -2
  30. package/dist/esm/stories/button.stories.js +1 -1
  31. package/dist/esm/stories/button.stories.js.map +2 -2
  32. package/dist/esm/stories/heading.stories.d.ts +2 -2
  33. package/dist/esm/stories/heading.stories.js +1 -1
  34. package/dist/esm/stories/heading.stories.js.map +2 -2
  35. package/dist/esm/stories/text.stories.d.ts +12 -3
  36. package/dist/esm/stories/text.stories.js +2 -2
  37. package/dist/esm/stories/text.stories.js.map +3 -3
  38. package/package.json +1 -1
  39. package/src/components/button.tsx +2 -2
  40. package/src/components/heading.tsx +5 -5
  41. package/src/components/text.tsx +13 -5
  42. package/src/icons/spinner.tsx +5 -6
  43. package/src/stories/button.stories.tsx +19 -1
  44. package/src/stories/heading.stories.tsx +2 -2
  45. package/src/stories/text.stories.tsx +28 -8
  46. package/src/styles/global.css +13 -7
  47. package/style.css +26 -14
@@ -26,7 +26,7 @@ const meta = {
26
26
  defaultValue: { summary: 'none' },
27
27
  },
28
28
  },
29
- weights: {
29
+ weight: {
30
30
  control: {
31
31
  type: 'select',
32
32
  },
@@ -59,6 +59,13 @@ const meta = {
59
59
  defaultValue: { summary: 'span' },
60
60
  },
61
61
  },
62
+ lineHeights: {
63
+ control: {
64
+ type: 'select',
65
+ },
66
+ description: '字体行高,tight是1.2、normal是1.4、loose是1.6',
67
+ options: ['tight', 'normal', 'loose'],
68
+ },
62
69
  html: {
63
70
  type: 'string',
64
71
  description: '相当于 dangerouslySetInnerHTML',
@@ -66,8 +73,9 @@ const meta = {
66
73
  },
67
74
  args: {
68
75
  size: 'none',
69
- weights: 'normal',
76
+ weight: 'normal',
70
77
  align: 'left',
78
+ lineHeights: 'normal',
71
79
  html: '',
72
80
  as: 'p',
73
81
  },
@@ -80,7 +88,7 @@ export const Default: Story = {
80
88
  args: {
81
89
  children: ' The quick brown fox jumps over the lazy dog.',
82
90
  size: 'none',
83
- weights: 'normal',
91
+ weight: 'normal',
84
92
  },
85
93
  }
86
94
 
@@ -102,14 +110,26 @@ export const Sizes: Story = {
102
110
  },
103
111
  }
104
112
 
105
- export const Weights: Story = {
113
+ export const weight: Story = {
114
+ render() {
115
+ return (
116
+ <div className="ai-flex ai-flex-col">
117
+ <Text weight="light">The quick brown fox jumps over the lazy dog.</Text>
118
+ <Text weight="normal">The quick brown fox jumps over the lazy dog.</Text>
119
+ <Text weight="medium">The quick brown fox jumps over the lazy dog.</Text>
120
+ <Text weight="bold">The quick brown fox jumps over the lazy dog.</Text>
121
+ </div>
122
+ )
123
+ },
124
+ }
125
+
126
+ export const LineHeights: Story = {
106
127
  render() {
107
128
  return (
108
129
  <div className="ai-flex ai-flex-col">
109
- <Text weights="light">The quick brown fox jumps over the lazy dog.</Text>
110
- <Text weights="normal">The quick brown fox jumps over the lazy dog.</Text>
111
- <Text weights="medium">The quick brown fox jumps over the lazy dog.</Text>
112
- <Text weights="bold">The quick brown fox jumps over the lazy dog.</Text>
130
+ <Text lineHeights="tight">The quick brown fox jumps over the lazy dog.</Text>
131
+ <Text lineHeights="normal">The quick brown fox jumps over the lazy dog.</Text>
132
+ <Text lineHeights="loose">The quick brown fox jumps over the lazy dog.</Text>
113
133
  </div>
114
134
  )
115
135
  },
@@ -65,19 +65,25 @@
65
65
  }
66
66
 
67
67
  :root[data-brand-theme='anker'] {
68
- --btn-bg-color: #00a7e1;
68
+ --btn-bg-color: #00befa;
69
69
  --btn-text-color: #ffffff;
70
- --btn-bg-active-color: #02b8f4;
71
- --btn-bg-disabled-color: #ccdfe850;
70
+ --btn-bg-active-color: #00aaff;
71
+ --btn-bg-disabled-color: rgba(29, 62, 79, 0.7);
72
72
 
73
73
  --btn-bg-secondary-color: #ffffff;
74
- --btn-text-secondary-color: #333333;
75
- --btn-bg-secondary-active-color: #555555;
76
- --btn-bg-secondary-disabled-color: #f5f5f550;
74
+ --btn-text-secondary-color: #1d1d1f;
75
+ --btn-bg-secondary-active-color: #6e6e73;
76
+ --btn-bg-secondary-disabled-color: rgba(221, 221, 221, 0.7);
77
+ --btn-border-secondary-border-color: #acacac;
77
78
 
78
- --btn-radius: 9999px;
79
+ --btn-radius: 0;
79
80
 
80
81
  --radius: 0em;
82
+
83
+ --letter-spacing-normal: -0.02em;
84
+ --line-height-tight: 1.2;
85
+ --line-height-normal: 1.4;
86
+ --line-height-loose: 1.6;
81
87
  }
82
88
 
83
89
  :root[data-brand-theme='eufy'] {
package/style.css CHANGED
@@ -515,9 +515,6 @@ video {
515
515
  .\!ai-pointer-events-none {
516
516
  pointer-events: none !important;
517
517
  }
518
- .\!ai-pointer-events-auto {
519
- pointer-events: auto !important;
520
- }
521
518
  .ai-fixed {
522
519
  position: fixed;
523
520
  }
@@ -645,9 +642,6 @@ video {
645
642
  .\!ai-cursor-default {
646
643
  cursor: default !important;
647
644
  }
648
- .\!ai-cursor-not-allowed {
649
- cursor: not-allowed !important;
650
- }
651
645
  .\!ai-select-none {
652
646
  -webkit-user-select: none !important;
653
647
  -moz-user-select: none !important;
@@ -848,9 +842,21 @@ video {
848
842
  .ai-font-semibold {
849
843
  font-weight: 600;
850
844
  }
845
+ .ai-leading-loose {
846
+ line-height: var(--line-height-loose);
847
+ }
851
848
  .ai-leading-none {
852
849
  line-height: 1;
853
850
  }
851
+ .ai-leading-normal {
852
+ line-height: var(--line-height-normal);
853
+ }
854
+ .ai-leading-tight {
855
+ line-height: var(--line-height-tight);
856
+ }
857
+ .ai-tracking {
858
+ letter-spacing: var(--letter-spacing-normal);
859
+ }
854
860
  .ai-tracking-tight {
855
861
  letter-spacing: -0.025em;
856
862
  }
@@ -981,19 +987,25 @@ video {
981
987
  }
982
988
 
983
989
  :root[data-brand-theme='anker'] {
984
- --btn-bg-color: #00a7e1;
990
+ --btn-bg-color: #00befa;
985
991
  --btn-text-color: #ffffff;
986
- --btn-bg-active-color: #02b8f4;
987
- --btn-bg-disabled-color: #ccdfe850;
992
+ --btn-bg-active-color: #00aaff;
993
+ --btn-bg-disabled-color: rgba(29, 62, 79, 0.7);
988
994
 
989
995
  --btn-bg-secondary-color: #ffffff;
990
- --btn-text-secondary-color: #333333;
991
- --btn-bg-secondary-active-color: #555555;
992
- --btn-bg-secondary-disabled-color: #f5f5f550;
996
+ --btn-text-secondary-color: #1d1d1f;
997
+ --btn-bg-secondary-active-color: #6e6e73;
998
+ --btn-bg-secondary-disabled-color: rgba(221, 221, 221, 0.7);
999
+ --btn-border-secondary-border-color: #acacac;
993
1000
 
994
- --btn-radius: 9999px;
1001
+ --btn-radius: 0;
995
1002
 
996
1003
  --radius: 0em;
1004
+
1005
+ --letter-spacing-normal: -0.02em;
1006
+ --line-height-tight: 1.2;
1007
+ --line-height-normal: 1.4;
1008
+ --line-height-loose: 1.6;
997
1009
  }
998
1010
 
999
1011
  :root[data-brand-theme='eufy'] {
@@ -1293,7 +1305,7 @@ video {
1293
1305
  }
1294
1306
 
1295
1307
  .disabled\:ai-text-btn-secondary-disabled-foreground:disabled {
1296
- color: var(--quaternary-color);
1308
+ color: var(--btn-border-secondary-border-color);
1297
1309
  }
1298
1310
 
1299
1311
  .disabled\:ai-opacity-50:disabled {