@semiont/react-ui 0.2.45 → 0.3.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 (220) hide show
  1. package/dist/{PdfAnnotationCanvas.client-COQREPXU.mjs → PdfAnnotationCanvas.client-PVTVPDBQ.mjs} +3 -4
  2. package/dist/PdfAnnotationCanvas.client-PVTVPDBQ.mjs.map +1 -0
  3. package/dist/{ar-7SUXNE34.mjs → ar-APUOG2AP.mjs} +46 -6
  4. package/dist/ar-APUOG2AP.mjs.map +1 -0
  5. package/dist/{bn-XOET3DOI.mjs → bn-EFK2LJGK.mjs} +46 -6
  6. package/dist/bn-EFK2LJGK.mjs.map +1 -0
  7. package/dist/{chunk-JH7BXE2P.mjs → chunk-7DW2P4UE.mjs} +45 -5
  8. package/dist/chunk-7DW2P4UE.mjs.map +1 -0
  9. package/dist/{chunk-Q2KV6Y2J.mjs → chunk-7GEYABC6.mjs} +32 -32
  10. package/dist/{chunk-3JTO27MH.mjs → chunk-D4GAAQMM.mjs} +2 -9
  11. package/dist/{cs-X63DXX7L.mjs → cs-A26MEEQE.mjs} +46 -6
  12. package/dist/cs-A26MEEQE.mjs.map +1 -0
  13. package/dist/{da-OWTCV57A.mjs → da-U3L2FHSZ.mjs} +46 -6
  14. package/dist/da-U3L2FHSZ.mjs.map +1 -0
  15. package/dist/{de-77BMFDVF.mjs → de-Y5BHEBT7.mjs} +46 -6
  16. package/dist/de-Y5BHEBT7.mjs.map +1 -0
  17. package/dist/dist-YLEIY3JJ.mjs +547 -0
  18. package/dist/dist-YLEIY3JJ.mjs.map +1 -0
  19. package/dist/{el-FIBNLH2V.mjs → el-HU7LAWQY.mjs} +46 -6
  20. package/dist/el-HU7LAWQY.mjs.map +1 -0
  21. package/dist/{en-XWEPVTB4.mjs → en-HAKDCFKL.mjs} +5 -3
  22. package/dist/{es-726NTS53.mjs → es-4BN64QH5.mjs} +46 -6
  23. package/dist/es-4BN64QH5.mjs.map +1 -0
  24. package/dist/{fa-3N4CIWE6.mjs → fa-6ELTBARU.mjs} +46 -6
  25. package/dist/fa-6ELTBARU.mjs.map +1 -0
  26. package/dist/{fi-JOM3M7Z4.mjs → fi-DJ4WGIFW.mjs} +46 -6
  27. package/dist/fi-DJ4WGIFW.mjs.map +1 -0
  28. package/dist/{fr-56QSXS7E.mjs → fr-23XM6H6H.mjs} +46 -6
  29. package/dist/fr-23XM6H6H.mjs.map +1 -0
  30. package/dist/{he-SNAXPJEK.mjs → he-JSWJC2XU.mjs} +46 -6
  31. package/dist/he-JSWJC2XU.mjs.map +1 -0
  32. package/dist/{hi-CRBRD5TB.mjs → hi-BENHG3OJ.mjs} +46 -6
  33. package/dist/hi-BENHG3OJ.mjs.map +1 -0
  34. package/dist/{id-BRCVLICF.mjs → id-4HHQJQNF.mjs} +46 -6
  35. package/dist/id-4HHQJQNF.mjs.map +1 -0
  36. package/dist/index.css +108 -12
  37. package/dist/index.css.map +1 -1
  38. package/dist/index.d.mts +399 -147
  39. package/dist/index.mjs +3573 -2226
  40. package/dist/index.mjs.map +1 -1
  41. package/dist/{it-M2Z27BNB.mjs → it-U6I5PDKU.mjs} +46 -6
  42. package/dist/it-U6I5PDKU.mjs.map +1 -0
  43. package/dist/{ja-TZUKW7HD.mjs → ja-K3YBDWDP.mjs} +46 -6
  44. package/dist/ja-K3YBDWDP.mjs.map +1 -0
  45. package/dist/{ko-NKBGGOL6.mjs → ko-KC2HXRXG.mjs} +46 -6
  46. package/dist/ko-KC2HXRXG.mjs.map +1 -0
  47. package/dist/{magic-string.es-7FJ3LUGB.mjs → magic-string.es-K77I4ZQN.mjs} +2 -2
  48. package/dist/{ms-XFXPN6RX.mjs → ms-KY5QGBNN.mjs} +46 -6
  49. package/dist/ms-KY5QGBNN.mjs.map +1 -0
  50. package/dist/{nl-MVYXAS5C.mjs → nl-6PZFLGY2.mjs} +46 -6
  51. package/dist/nl-6PZFLGY2.mjs.map +1 -0
  52. package/dist/{no-XOLO4JPV.mjs → no-5QR7PLVJ.mjs} +46 -6
  53. package/dist/no-5QR7PLVJ.mjs.map +1 -0
  54. package/dist/{pl-TRWLMMC4.mjs → pl-4GV2NQXE.mjs} +46 -6
  55. package/dist/pl-4GV2NQXE.mjs.map +1 -0
  56. package/dist/{pt-M3TE24UI.mjs → pt-F3F5QD2P.mjs} +46 -6
  57. package/dist/pt-F3F5QD2P.mjs.map +1 -0
  58. package/dist/{ro-QBFG2T64.mjs → ro-TFYL2IQB.mjs} +46 -6
  59. package/dist/ro-TFYL2IQB.mjs.map +1 -0
  60. package/dist/{sv-IUECBXWX.mjs → sv-PRVF2QLR.mjs} +46 -6
  61. package/dist/sv-PRVF2QLR.mjs.map +1 -0
  62. package/dist/test-utils.mjs +16994 -22140
  63. package/dist/test-utils.mjs.map +1 -1
  64. package/dist/{th-US7KIN5Q.mjs → th-SUQOQFUZ.mjs} +46 -6
  65. package/dist/th-SUQOQFUZ.mjs.map +1 -0
  66. package/dist/{tr-DWJ2FFUK.mjs → tr-AYUJZOFJ.mjs} +46 -6
  67. package/dist/tr-AYUJZOFJ.mjs.map +1 -0
  68. package/dist/{uk-M4ZE4DPZ.mjs → uk-YY5WGLBM.mjs} +46 -6
  69. package/dist/uk-YY5WGLBM.mjs.map +1 -0
  70. package/dist/{vi-FERZNPSH.mjs → vi-6RO77ITD.mjs} +46 -6
  71. package/dist/{vi-FERZNPSH.mjs.map → vi-6RO77ITD.mjs.map} +1 -1
  72. package/dist/{zh-3J2I3WYK.mjs → zh-L6GA65H6.mjs} +46 -6
  73. package/dist/zh-L6GA65H6.mjs.map +1 -0
  74. package/package.json +18 -14
  75. package/src/components/Button/Button.tsx +23 -25
  76. package/src/components/annotation/AnnotateToolbar.tsx +1 -1
  77. package/src/components/annotation-popups/SharedPopupElements.tsx +5 -7
  78. package/src/components/image-annotation/SvgDrawingCanvas.tsx +3 -4
  79. package/src/components/modals/ConfigureGenerationStep.tsx +190 -0
  80. package/src/components/modals/ConfigureSearchStep.tsx +105 -0
  81. package/src/components/modals/ContextSummary.tsx +183 -0
  82. package/src/components/modals/GatherContextStep.tsx +89 -0
  83. package/src/components/modals/KeyboardShortcutsHelpModal.tsx +4 -6
  84. package/src/components/modals/ProposeEntitiesModal.tsx +4 -6
  85. package/src/components/modals/ReferenceWizardModal.tsx +326 -0
  86. package/src/components/modals/ResourceSearchModal.tsx +4 -6
  87. package/src/components/modals/SearchModal.css +43 -0
  88. package/src/components/modals/SearchModal.tsx +4 -6
  89. package/src/components/modals/SearchResultsStep.tsx +126 -0
  90. package/src/components/pdf-annotation/PdfAnnotationCanvas.tsx +3 -4
  91. package/src/components/pdf-annotation/__tests__/PdfAnnotationCanvas.test.tsx +36 -14
  92. package/src/components/resource/AnnotateView.tsx +4 -4
  93. package/src/components/resource/AnnotationHistory.tsx +2 -2
  94. package/src/components/resource/BrowseView.tsx +4 -4
  95. package/src/components/resource/ResourceViewer.tsx +5 -8
  96. package/src/components/resource/__tests__/AnnotationHistory.test.tsx +16 -16
  97. package/src/components/resource/__tests__/BrowseView.test.tsx +2 -2
  98. package/src/components/resource/__tests__/HistoryEvent.test.tsx +1 -1
  99. package/src/components/resource/__tests__/ResourceViewer.mode-switch.test.tsx +1 -1
  100. package/src/components/resource/panels/AssessmentEntry.tsx +9 -11
  101. package/src/components/resource/panels/AssessmentPanel.tsx +1 -1
  102. package/src/components/resource/panels/CommentEntry.tsx +10 -12
  103. package/src/components/resource/panels/CommentsPanel.tsx +1 -1
  104. package/src/components/resource/panels/HighlightEntry.tsx +9 -11
  105. package/src/components/resource/panels/HighlightPanel.tsx +2 -2
  106. package/src/components/resource/panels/ReferenceEntry.tsx +57 -104
  107. package/src/components/resource/panels/ReferencesPanel.css +85 -13
  108. package/src/components/resource/panels/ReferencesPanel.tsx +2 -3
  109. package/src/components/resource/panels/TagEntry.tsx +9 -11
  110. package/src/components/resource/panels/TaggingPanel.tsx +1 -1
  111. package/src/components/resource/panels/__tests__/AssessmentPanel.test.tsx +4 -4
  112. package/src/components/resource/panels/__tests__/AssistSection.test.tsx +7 -7
  113. package/src/components/resource/panels/__tests__/CommentsPanel.test.tsx +3 -3
  114. package/src/components/resource/panels/__tests__/HighlightPanel.annotationProgress.test.tsx +2 -2
  115. package/src/components/resource/panels/__tests__/ReferenceEntry.test.tsx +64 -101
  116. package/src/components/resource/panels/__tests__/StatisticsPanel.test.tsx +1 -1
  117. package/src/components/resource/panels/__tests__/TaggingPanel.test.tsx +7 -7
  118. package/src/components/viewers/ImageViewer.tsx +3 -6
  119. package/src/components/viewers/__tests__/ImageViewer.test.tsx +3 -3
  120. package/src/features/admin-devops/__tests__/AdminDevOpsPage.test.tsx +5 -5
  121. package/src/features/admin-exchange/__tests__/AdminExchangePage.test.tsx +141 -0
  122. package/src/features/admin-exchange/__tests__/ExportCard.test.tsx +41 -0
  123. package/src/features/admin-exchange/__tests__/ImportCard.test.tsx +148 -0
  124. package/src/features/admin-exchange/__tests__/ImportProgress.test.tsx +106 -0
  125. package/src/features/admin-exchange/components/AdminExchangePage.tsx +120 -0
  126. package/src/features/admin-exchange/components/ExportCard.tsx +35 -0
  127. package/src/features/admin-exchange/components/ImportCard.tsx +188 -0
  128. package/src/features/admin-exchange/components/ImportProgress.tsx +86 -0
  129. package/src/features/admin-security/__tests__/AdminSecurityPage.test.tsx +3 -3
  130. package/src/features/moderate-entity-tags/__tests__/EntityTagsPage.test.tsx +2 -2
  131. package/src/features/moderate-recent/__tests__/RecentDocumentsPage.test.tsx +4 -4
  132. package/src/features/moderate-tag-schemas/__tests__/TagSchemasPage.test.tsx +3 -3
  133. package/src/features/moderation-linked-data/__tests__/LinkedDataPage.test.tsx +117 -0
  134. package/src/features/moderation-linked-data/components/LinkedDataPage.tsx +121 -0
  135. package/src/features/resource-compose/__tests__/ResourceComposePage.test.tsx +5 -5
  136. package/src/features/resource-compose/components/ResourceComposePage.tsx +56 -1
  137. package/src/features/resource-discovery/__tests__/ResourceCard.test.tsx +1 -1
  138. package/src/features/resource-discovery/__tests__/ResourceDiscoveryPage.test.tsx +2 -2
  139. package/src/features/resource-viewer/__tests__/AnnotationCreationPending.test.tsx +14 -14
  140. package/src/features/resource-viewer/__tests__/AnnotationDeletionIntegration.test.tsx +12 -11
  141. package/src/features/resource-viewer/__tests__/AnnotationProgressDismissal.test.tsx +2 -2
  142. package/src/features/resource-viewer/__tests__/BindFlowIntegration.test.tsx +22 -115
  143. package/src/features/resource-viewer/__tests__/DetectionFlowBug.test.tsx +3 -3
  144. package/src/features/resource-viewer/__tests__/DetectionFlowIntegration.test.tsx +20 -20
  145. package/src/features/resource-viewer/__tests__/ResourceMutations.test.tsx +7 -7
  146. package/src/features/resource-viewer/__tests__/ResourceViewerPage.test.tsx +43 -20
  147. package/src/features/resource-viewer/__tests__/ToastNotifications.test.tsx +2 -2
  148. package/src/features/resource-viewer/__tests__/YieldFlowIntegration.test.tsx +45 -82
  149. package/src/features/resource-viewer/__tests__/annotation-progress-flow.test.tsx +4 -4
  150. package/src/features/resource-viewer/components/ResourceViewerPage.tsx +151 -74
  151. package/src/integrations/tailwind-plugin.js +3 -3
  152. package/src/styles/core/buttons.css +31 -0
  153. package/src/styles/features/exchange.css +404 -0
  154. package/src/styles/index.css +1 -0
  155. package/translations/ar.json +42 -4
  156. package/translations/bn.json +42 -4
  157. package/translations/cs.json +42 -4
  158. package/translations/da.json +128 -90
  159. package/translations/de.json +122 -84
  160. package/translations/el.json +42 -4
  161. package/translations/en.json +42 -4
  162. package/translations/es.json +42 -4
  163. package/translations/fa.json +42 -4
  164. package/translations/fi.json +68 -30
  165. package/translations/fr.json +42 -4
  166. package/translations/he.json +42 -4
  167. package/translations/hi.json +42 -4
  168. package/translations/id.json +43 -5
  169. package/translations/it.json +62 -24
  170. package/translations/ja.json +43 -5
  171. package/translations/ko.json +42 -4
  172. package/translations/ms.json +43 -5
  173. package/translations/nl.json +41 -3
  174. package/translations/no.json +104 -66
  175. package/translations/pl.json +42 -4
  176. package/translations/pt.json +43 -5
  177. package/translations/ro.json +42 -4
  178. package/translations/sv.json +42 -4
  179. package/translations/th.json +42 -4
  180. package/translations/tr.json +42 -4
  181. package/translations/uk.json +42 -4
  182. package/translations/vi.json +42 -4
  183. package/translations/zh.json +42 -4
  184. package/dist/PdfAnnotationCanvas.client-COQREPXU.mjs.map +0 -1
  185. package/dist/ar-7SUXNE34.mjs.map +0 -1
  186. package/dist/bn-XOET3DOI.mjs.map +0 -1
  187. package/dist/chunk-JH7BXE2P.mjs.map +0 -1
  188. package/dist/cs-X63DXX7L.mjs.map +0 -1
  189. package/dist/da-OWTCV57A.mjs.map +0 -1
  190. package/dist/de-77BMFDVF.mjs.map +0 -1
  191. package/dist/el-FIBNLH2V.mjs.map +0 -1
  192. package/dist/es-726NTS53.mjs.map +0 -1
  193. package/dist/fa-3N4CIWE6.mjs.map +0 -1
  194. package/dist/fi-JOM3M7Z4.mjs.map +0 -1
  195. package/dist/fr-56QSXS7E.mjs.map +0 -1
  196. package/dist/he-SNAXPJEK.mjs.map +0 -1
  197. package/dist/hi-CRBRD5TB.mjs.map +0 -1
  198. package/dist/id-BRCVLICF.mjs.map +0 -1
  199. package/dist/it-M2Z27BNB.mjs.map +0 -1
  200. package/dist/ja-TZUKW7HD.mjs.map +0 -1
  201. package/dist/ko-NKBGGOL6.mjs.map +0 -1
  202. package/dist/ms-XFXPN6RX.mjs.map +0 -1
  203. package/dist/nl-MVYXAS5C.mjs.map +0 -1
  204. package/dist/no-XOLO4JPV.mjs.map +0 -1
  205. package/dist/pl-TRWLMMC4.mjs.map +0 -1
  206. package/dist/pt-M3TE24UI.mjs.map +0 -1
  207. package/dist/ro-QBFG2T64.mjs.map +0 -1
  208. package/dist/sv-IUECBXWX.mjs.map +0 -1
  209. package/dist/th-US7KIN5Q.mjs.map +0 -1
  210. package/dist/tr-DWJ2FFUK.mjs.map +0 -1
  211. package/dist/uk-M4ZE4DPZ.mjs.map +0 -1
  212. package/dist/zh-3J2I3WYK.mjs.map +0 -1
  213. package/src/examples/ButtonUsageExample.tsx +0 -242
  214. package/src/examples/button-css-modules.module.css +0 -164
  215. package/src/examples/button-styled-components.tsx +0 -215
  216. package/src/examples/button-tailwind.css +0 -51
  217. /package/dist/{chunk-Q2KV6Y2J.mjs.map → chunk-7GEYABC6.mjs.map} +0 -0
  218. /package/dist/{chunk-3JTO27MH.mjs.map → chunk-D4GAAQMM.mjs.map} +0 -0
  219. /package/dist/{en-XWEPVTB4.mjs.map → en-HAKDCFKL.mjs.map} +0 -0
  220. /package/dist/{magic-string.es-7FJ3LUGB.mjs.map → magic-string.es-K77I4ZQN.mjs.map} +0 -0
@@ -1,164 +0,0 @@
1
- /**
2
- * Example: Button styling with CSS Modules
3
- *
4
- * This shows how to style the Button component using CSS Modules
5
- * by targeting the data attributes with module-scoped styles.
6
- */
7
-
8
- /* Base button styles */
9
- .button {
10
- position: relative;
11
- display: inline-flex;
12
- align-items: center;
13
- justify-content: center;
14
- font-family: system-ui, -apple-system, sans-serif;
15
- font-weight: 500;
16
- border: none;
17
- cursor: pointer;
18
- transition: all 0.2s ease;
19
- outline: none;
20
- }
21
-
22
- /* Primary variant */
23
- .button[data-variant="primary"] {
24
- background-color: #0080ff;
25
- color: #ffffff;
26
- }
27
-
28
- .button[data-variant="primary"]:hover:not(:disabled) {
29
- background-color: #0066cc;
30
- }
31
-
32
- .button[data-variant="primary"]:active:not(:disabled) {
33
- background-color: #0052a3;
34
- }
35
-
36
- /* Secondary variant */
37
- .button[data-variant="secondary"] {
38
- background-color: #f3f4f6;
39
- color: #111827;
40
- }
41
-
42
- .button[data-variant="secondary"]:hover:not(:disabled) {
43
- background-color: #e5e7eb;
44
- }
45
-
46
- .button[data-variant="secondary"]:active:not(:disabled) {
47
- background-color: #d1d5db;
48
- }
49
-
50
- /* Ghost variant */
51
- .button[data-variant="ghost"] {
52
- background-color: transparent;
53
- color: currentColor;
54
- }
55
-
56
- .button[data-variant="ghost"]:hover:not(:disabled) {
57
- background-color: rgba(0, 0, 0, 0.05);
58
- }
59
-
60
- /* Size variants */
61
- .button[data-size="sm"] {
62
- padding: 0.375rem 0.75rem;
63
- font-size: 0.875rem;
64
- border-radius: 0.25rem;
65
- min-height: 2rem;
66
- }
67
-
68
- .button[data-size="md"] {
69
- padding: 0.5rem 1rem;
70
- font-size: 1rem;
71
- border-radius: 0.375rem;
72
- min-height: 2.5rem;
73
- }
74
-
75
- .button[data-size="lg"] {
76
- padding: 0.75rem 1.5rem;
77
- font-size: 1.125rem;
78
- border-radius: 0.375rem;
79
- min-height: 3rem;
80
- }
81
-
82
- /* Icon-only styles */
83
- .button[data-icon-only="true"][data-size="sm"] {
84
- padding: 0.375rem;
85
- width: 2rem;
86
- }
87
-
88
- .button[data-icon-only="true"][data-size="md"] {
89
- padding: 0.5rem;
90
- width: 2.5rem;
91
- }
92
-
93
- .button[data-icon-only="true"][data-size="lg"] {
94
- padding: 0.75rem;
95
- width: 3rem;
96
- }
97
-
98
- /* Full width */
99
- .button[data-full-width="true"] {
100
- width: 100%;
101
- }
102
-
103
- /* Loading state */
104
- .button[data-loading="true"] {
105
- color: transparent;
106
- pointer-events: none;
107
- }
108
-
109
- .spinner {
110
- position: absolute;
111
- top: 50%;
112
- left: 50%;
113
- transform: translate(-50%, -50%);
114
- animation: spin 1s linear infinite;
115
- }
116
-
117
- @keyframes spin {
118
- from {
119
- transform: translate(-50%, -50%) rotate(0deg);
120
- }
121
- to {
122
- transform: translate(-50%, -50%) rotate(360deg);
123
- }
124
- }
125
-
126
- /* Focus styles */
127
- .button:focus-visible {
128
- outline: 2px solid #0080ff;
129
- outline-offset: 2px;
130
- }
131
-
132
- /* Disabled state */
133
- .button:disabled,
134
- .button[data-disabled="true"] {
135
- opacity: 0.5;
136
- cursor: not-allowed;
137
- }
138
-
139
- /* Icon spacing */
140
- .iconLeft {
141
- margin-right: 0.5rem;
142
- }
143
-
144
- .iconRight {
145
- margin-left: 0.5rem;
146
- }
147
-
148
- /* Reduced motion support */
149
- @media (prefers-reduced-motion: reduce) {
150
- .button {
151
- transition: none !important;
152
- }
153
-
154
- .spinner {
155
- animation: none !important;
156
- transform: translate(-50%, -50%) !important;
157
- }
158
-
159
- @keyframes spin {
160
- from, to {
161
- transform: translate(-50%, -50%);
162
- }
163
- }
164
- }
@@ -1,215 +0,0 @@
1
- /**
2
- * Example: Button styling with Styled Components (CSS-in-JS)
3
- *
4
- * This shows how to style the Button component using styled-components
5
- * by wrapping it and styling based on data attributes.
6
- */
7
-
8
- import styled from 'styled-components';
9
- import { Button as SemiontButton } from '../components/Button/Button';
10
-
11
- // Styled wrapper for the Button component
12
- export const StyledButton = styled(SemiontButton)`
13
- /* Base styles */
14
- position: relative;
15
- display: inline-flex;
16
- align-items: center;
17
- justify-content: center;
18
- font-family: ${props => props.theme?.typography?.fontFamily?.sans || 'system-ui, -apple-system, sans-serif'};
19
- font-weight: 500;
20
- border: none;
21
- cursor: pointer;
22
- transition: all 0.2s ease;
23
- outline: none;
24
-
25
- /* Primary variant */
26
- &[data-variant="primary"] {
27
- background-color: ${props => props.theme?.colors?.primary?.[500] || '#0080ff'};
28
- color: white;
29
-
30
- &:hover:not(:disabled) {
31
- background-color: ${props => props.theme?.colors?.primary?.[600] || '#0066cc'};
32
- }
33
-
34
- &:active:not(:disabled) {
35
- background-color: ${props => props.theme?.colors?.primary?.[700] || '#0052a3'};
36
- }
37
- }
38
-
39
- /* Secondary variant */
40
- &[data-variant="secondary"] {
41
- background-color: ${props => props.theme?.colors?.neutral?.[100] || '#f3f4f6'};
42
- color: ${props => props.theme?.colors?.neutral?.[900] || '#111827'};
43
-
44
- &:hover:not(:disabled) {
45
- background-color: ${props => props.theme?.colors?.neutral?.[200] || '#e5e7eb'};
46
- }
47
-
48
- &:active:not(:disabled) {
49
- background-color: ${props => props.theme?.colors?.neutral?.[300] || '#d1d5db'};
50
- }
51
- }
52
-
53
- /* Tertiary variant */
54
- &[data-variant="tertiary"] {
55
- background-color: transparent;
56
- color: ${props => props.theme?.colors?.primary?.[500] || '#0080ff'};
57
- box-shadow: inset 0 0 0 1px ${props => (props.theme?.colors?.primary?.[500] || '#0080ff') + '33'};
58
-
59
- &:hover:not(:disabled) {
60
- background-color: ${props => (props.theme?.colors?.primary?.[500] || '#0080ff') + '0a'};
61
- }
62
- }
63
-
64
- /* Ghost variant */
65
- &[data-variant="ghost"] {
66
- background-color: transparent;
67
- color: inherit;
68
-
69
- &:hover:not(:disabled) {
70
- background-color: rgba(0, 0, 0, 0.05);
71
- }
72
-
73
- &:active:not(:disabled) {
74
- background-color: rgba(0, 0, 0, 0.1);
75
- }
76
- }
77
-
78
- /* Danger variant */
79
- &[data-variant="danger"] {
80
- background-color: ${props => props.theme?.colors?.error || '#ef4444'};
81
- color: white;
82
-
83
- &:hover:not(:disabled) {
84
- background-color: ${props => props.theme?.colors?.errorDark || '#dc2626'};
85
- }
86
- }
87
-
88
- /* Warning variant */
89
- &[data-variant="warning"] {
90
- background-color: ${props => props.theme?.colors?.warning || '#f59e0b'};
91
- color: ${props => props.theme?.colors?.neutral?.[900] || '#111827'};
92
-
93
- &:hover:not(:disabled) {
94
- background-color: ${props => props.theme?.colors?.warningDark || '#d97706'};
95
- }
96
- }
97
-
98
- /* Size variants */
99
- &[data-size="xs"] {
100
- padding: 0.25rem 0.5rem;
101
- font-size: 0.75rem;
102
- border-radius: 0.125rem;
103
- min-height: 1.75rem;
104
- }
105
-
106
- &[data-size="sm"] {
107
- padding: 0.375rem 0.75rem;
108
- font-size: 0.875rem;
109
- border-radius: 0.25rem;
110
- min-height: 2rem;
111
- }
112
-
113
- &[data-size="md"] {
114
- padding: 0.5rem 1rem;
115
- font-size: 1rem;
116
- border-radius: 0.375rem;
117
- min-height: 2.5rem;
118
- }
119
-
120
- &[data-size="lg"] {
121
- padding: 0.625rem 1.5rem;
122
- font-size: 1.125rem;
123
- border-radius: 0.375rem;
124
- min-height: 3rem;
125
- }
126
-
127
- &[data-size="xl"] {
128
- padding: 0.75rem 2rem;
129
- font-size: 1.25rem;
130
- border-radius: 0.5rem;
131
- min-height: 3.5rem;
132
- }
133
-
134
- /* Icon-only buttons */
135
- &[data-icon-only="true"] {
136
- &[data-size="xs"] {
137
- padding: 0.25rem;
138
- width: 1.75rem;
139
- }
140
-
141
- &[data-size="sm"] {
142
- padding: 0.375rem;
143
- width: 2rem;
144
- }
145
-
146
- &[data-size="md"] {
147
- padding: 0.5rem;
148
- width: 2.5rem;
149
- }
150
-
151
- &[data-size="lg"] {
152
- padding: 0.625rem;
153
- width: 3rem;
154
- }
155
-
156
- &[data-size="xl"] {
157
- padding: 0.75rem;
158
- width: 3.5rem;
159
- }
160
- }
161
-
162
- /* Full width */
163
- &[data-full-width="true"] {
164
- width: 100%;
165
- }
166
-
167
- /* Loading state */
168
- &[data-loading="true"] {
169
- pointer-events: none;
170
- opacity: 0.75;
171
- }
172
-
173
- /* Focus styles */
174
- &:focus-visible {
175
- outline: 2px solid ${props => props.theme?.colors?.primary?.[500] || '#0080ff'};
176
- outline-offset: 2px;
177
- }
178
-
179
- /* Disabled state */
180
- &:disabled,
181
- &[data-disabled="true"] {
182
- opacity: 0.5;
183
- cursor: not-allowed;
184
- }
185
- `;
186
-
187
- // Example usage with theme
188
- /* const _theme = {
189
- colors: {
190
- primary: '#0080ff',
191
- primaryDark: '#0066cc',
192
- primaryDarker: '#0052a3',
193
- secondary: '#00ffff',
194
- danger: '#ef4444',
195
- dangerDark: '#dc2626',
196
- warning: '#f59e0b',
197
- warningDark: '#d97706',
198
- gray100: '#f3f4f6',
199
- gray200: '#e5e7eb',
200
- gray300: '#d1d5db',
201
- gray900: '#111827',
202
- },
203
- fonts: {
204
- sans: 'Inter, system-ui, -apple-system, sans-serif',
205
- }
206
- }; */
207
-
208
- // Example component using styled button
209
- export function ExampleStyledButton() {
210
- return (
211
- <StyledButton variant="primary" size="md">
212
- Styled Components Button
213
- </StyledButton>
214
- );
215
- }
@@ -1,51 +0,0 @@
1
- /**
2
- * Example: Button styling with Tailwind CSS
3
- *
4
- * This shows how to style the Button component using Tailwind utilities
5
- * by targeting the data attributes.
6
- */
7
-
8
- /* Primary button with Tailwind */
9
- .semiont-button[data-variant="primary"] {
10
- @apply bg-blue-500 text-white hover:bg-blue-600 active:bg-blue-700;
11
- @apply transition-colors duration-200;
12
- }
13
-
14
- /* Size variants with Tailwind */
15
- .semiont-button[data-size="sm"] {
16
- @apply px-3 py-1.5 text-sm rounded;
17
- }
18
-
19
- .semiont-button[data-size="md"] {
20
- @apply px-4 py-2 text-base rounded-md;
21
- }
22
-
23
- .semiont-button[data-size="lg"] {
24
- @apply px-6 py-3 text-lg rounded-md;
25
- }
26
-
27
- /* Loading state */
28
- .semiont-button[data-loading="true"] {
29
- @apply pointer-events-none opacity-75;
30
- }
31
-
32
- /* Full width */
33
- .semiont-button[data-full-width="true"] {
34
- @apply w-full;
35
- }
36
-
37
- /* Icon-only button */
38
- .semiont-button[data-icon-only="true"] {
39
- @apply p-2 aspect-square;
40
- }
41
-
42
- /* Focus styles */
43
- .semiont-button {
44
- @apply focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2;
45
- }
46
-
47
- /* Disabled state */
48
- .semiont-button:disabled,
49
- .semiont-button[data-disabled="true"] {
50
- @apply opacity-50 cursor-not-allowed;
51
- }