@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.
- package/dist/{PdfAnnotationCanvas.client-COQREPXU.mjs → PdfAnnotationCanvas.client-PVTVPDBQ.mjs} +3 -4
- package/dist/PdfAnnotationCanvas.client-PVTVPDBQ.mjs.map +1 -0
- package/dist/{ar-7SUXNE34.mjs → ar-APUOG2AP.mjs} +46 -6
- package/dist/ar-APUOG2AP.mjs.map +1 -0
- package/dist/{bn-XOET3DOI.mjs → bn-EFK2LJGK.mjs} +46 -6
- package/dist/bn-EFK2LJGK.mjs.map +1 -0
- package/dist/{chunk-JH7BXE2P.mjs → chunk-7DW2P4UE.mjs} +45 -5
- package/dist/chunk-7DW2P4UE.mjs.map +1 -0
- package/dist/{chunk-Q2KV6Y2J.mjs → chunk-7GEYABC6.mjs} +32 -32
- package/dist/{chunk-3JTO27MH.mjs → chunk-D4GAAQMM.mjs} +2 -9
- package/dist/{cs-X63DXX7L.mjs → cs-A26MEEQE.mjs} +46 -6
- package/dist/cs-A26MEEQE.mjs.map +1 -0
- package/dist/{da-OWTCV57A.mjs → da-U3L2FHSZ.mjs} +46 -6
- package/dist/da-U3L2FHSZ.mjs.map +1 -0
- package/dist/{de-77BMFDVF.mjs → de-Y5BHEBT7.mjs} +46 -6
- package/dist/de-Y5BHEBT7.mjs.map +1 -0
- package/dist/dist-YLEIY3JJ.mjs +547 -0
- package/dist/dist-YLEIY3JJ.mjs.map +1 -0
- package/dist/{el-FIBNLH2V.mjs → el-HU7LAWQY.mjs} +46 -6
- package/dist/el-HU7LAWQY.mjs.map +1 -0
- package/dist/{en-XWEPVTB4.mjs → en-HAKDCFKL.mjs} +5 -3
- package/dist/{es-726NTS53.mjs → es-4BN64QH5.mjs} +46 -6
- package/dist/es-4BN64QH5.mjs.map +1 -0
- package/dist/{fa-3N4CIWE6.mjs → fa-6ELTBARU.mjs} +46 -6
- package/dist/fa-6ELTBARU.mjs.map +1 -0
- package/dist/{fi-JOM3M7Z4.mjs → fi-DJ4WGIFW.mjs} +46 -6
- package/dist/fi-DJ4WGIFW.mjs.map +1 -0
- package/dist/{fr-56QSXS7E.mjs → fr-23XM6H6H.mjs} +46 -6
- package/dist/fr-23XM6H6H.mjs.map +1 -0
- package/dist/{he-SNAXPJEK.mjs → he-JSWJC2XU.mjs} +46 -6
- package/dist/he-JSWJC2XU.mjs.map +1 -0
- package/dist/{hi-CRBRD5TB.mjs → hi-BENHG3OJ.mjs} +46 -6
- package/dist/hi-BENHG3OJ.mjs.map +1 -0
- package/dist/{id-BRCVLICF.mjs → id-4HHQJQNF.mjs} +46 -6
- package/dist/id-4HHQJQNF.mjs.map +1 -0
- package/dist/index.css +108 -12
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +399 -147
- package/dist/index.mjs +3573 -2226
- package/dist/index.mjs.map +1 -1
- package/dist/{it-M2Z27BNB.mjs → it-U6I5PDKU.mjs} +46 -6
- package/dist/it-U6I5PDKU.mjs.map +1 -0
- package/dist/{ja-TZUKW7HD.mjs → ja-K3YBDWDP.mjs} +46 -6
- package/dist/ja-K3YBDWDP.mjs.map +1 -0
- package/dist/{ko-NKBGGOL6.mjs → ko-KC2HXRXG.mjs} +46 -6
- package/dist/ko-KC2HXRXG.mjs.map +1 -0
- package/dist/{magic-string.es-7FJ3LUGB.mjs → magic-string.es-K77I4ZQN.mjs} +2 -2
- package/dist/{ms-XFXPN6RX.mjs → ms-KY5QGBNN.mjs} +46 -6
- package/dist/ms-KY5QGBNN.mjs.map +1 -0
- package/dist/{nl-MVYXAS5C.mjs → nl-6PZFLGY2.mjs} +46 -6
- package/dist/nl-6PZFLGY2.mjs.map +1 -0
- package/dist/{no-XOLO4JPV.mjs → no-5QR7PLVJ.mjs} +46 -6
- package/dist/no-5QR7PLVJ.mjs.map +1 -0
- package/dist/{pl-TRWLMMC4.mjs → pl-4GV2NQXE.mjs} +46 -6
- package/dist/pl-4GV2NQXE.mjs.map +1 -0
- package/dist/{pt-M3TE24UI.mjs → pt-F3F5QD2P.mjs} +46 -6
- package/dist/pt-F3F5QD2P.mjs.map +1 -0
- package/dist/{ro-QBFG2T64.mjs → ro-TFYL2IQB.mjs} +46 -6
- package/dist/ro-TFYL2IQB.mjs.map +1 -0
- package/dist/{sv-IUECBXWX.mjs → sv-PRVF2QLR.mjs} +46 -6
- package/dist/sv-PRVF2QLR.mjs.map +1 -0
- package/dist/test-utils.mjs +16994 -22140
- package/dist/test-utils.mjs.map +1 -1
- package/dist/{th-US7KIN5Q.mjs → th-SUQOQFUZ.mjs} +46 -6
- package/dist/th-SUQOQFUZ.mjs.map +1 -0
- package/dist/{tr-DWJ2FFUK.mjs → tr-AYUJZOFJ.mjs} +46 -6
- package/dist/tr-AYUJZOFJ.mjs.map +1 -0
- package/dist/{uk-M4ZE4DPZ.mjs → uk-YY5WGLBM.mjs} +46 -6
- package/dist/uk-YY5WGLBM.mjs.map +1 -0
- package/dist/{vi-FERZNPSH.mjs → vi-6RO77ITD.mjs} +46 -6
- package/dist/{vi-FERZNPSH.mjs.map → vi-6RO77ITD.mjs.map} +1 -1
- package/dist/{zh-3J2I3WYK.mjs → zh-L6GA65H6.mjs} +46 -6
- package/dist/zh-L6GA65H6.mjs.map +1 -0
- package/package.json +18 -14
- package/src/components/Button/Button.tsx +23 -25
- package/src/components/annotation/AnnotateToolbar.tsx +1 -1
- package/src/components/annotation-popups/SharedPopupElements.tsx +5 -7
- package/src/components/image-annotation/SvgDrawingCanvas.tsx +3 -4
- package/src/components/modals/ConfigureGenerationStep.tsx +190 -0
- package/src/components/modals/ConfigureSearchStep.tsx +105 -0
- package/src/components/modals/ContextSummary.tsx +183 -0
- package/src/components/modals/GatherContextStep.tsx +89 -0
- package/src/components/modals/KeyboardShortcutsHelpModal.tsx +4 -6
- package/src/components/modals/ProposeEntitiesModal.tsx +4 -6
- package/src/components/modals/ReferenceWizardModal.tsx +326 -0
- package/src/components/modals/ResourceSearchModal.tsx +4 -6
- package/src/components/modals/SearchModal.css +43 -0
- package/src/components/modals/SearchModal.tsx +4 -6
- package/src/components/modals/SearchResultsStep.tsx +126 -0
- package/src/components/pdf-annotation/PdfAnnotationCanvas.tsx +3 -4
- package/src/components/pdf-annotation/__tests__/PdfAnnotationCanvas.test.tsx +36 -14
- package/src/components/resource/AnnotateView.tsx +4 -4
- package/src/components/resource/AnnotationHistory.tsx +2 -2
- package/src/components/resource/BrowseView.tsx +4 -4
- package/src/components/resource/ResourceViewer.tsx +5 -8
- package/src/components/resource/__tests__/AnnotationHistory.test.tsx +16 -16
- package/src/components/resource/__tests__/BrowseView.test.tsx +2 -2
- package/src/components/resource/__tests__/HistoryEvent.test.tsx +1 -1
- package/src/components/resource/__tests__/ResourceViewer.mode-switch.test.tsx +1 -1
- package/src/components/resource/panels/AssessmentEntry.tsx +9 -11
- package/src/components/resource/panels/AssessmentPanel.tsx +1 -1
- package/src/components/resource/panels/CommentEntry.tsx +10 -12
- package/src/components/resource/panels/CommentsPanel.tsx +1 -1
- package/src/components/resource/panels/HighlightEntry.tsx +9 -11
- package/src/components/resource/panels/HighlightPanel.tsx +2 -2
- package/src/components/resource/panels/ReferenceEntry.tsx +57 -104
- package/src/components/resource/panels/ReferencesPanel.css +85 -13
- package/src/components/resource/panels/ReferencesPanel.tsx +2 -3
- package/src/components/resource/panels/TagEntry.tsx +9 -11
- package/src/components/resource/panels/TaggingPanel.tsx +1 -1
- package/src/components/resource/panels/__tests__/AssessmentPanel.test.tsx +4 -4
- package/src/components/resource/panels/__tests__/AssistSection.test.tsx +7 -7
- package/src/components/resource/panels/__tests__/CommentsPanel.test.tsx +3 -3
- package/src/components/resource/panels/__tests__/HighlightPanel.annotationProgress.test.tsx +2 -2
- package/src/components/resource/panels/__tests__/ReferenceEntry.test.tsx +64 -101
- package/src/components/resource/panels/__tests__/StatisticsPanel.test.tsx +1 -1
- package/src/components/resource/panels/__tests__/TaggingPanel.test.tsx +7 -7
- package/src/components/viewers/ImageViewer.tsx +3 -6
- package/src/components/viewers/__tests__/ImageViewer.test.tsx +3 -3
- package/src/features/admin-devops/__tests__/AdminDevOpsPage.test.tsx +5 -5
- package/src/features/admin-exchange/__tests__/AdminExchangePage.test.tsx +141 -0
- package/src/features/admin-exchange/__tests__/ExportCard.test.tsx +41 -0
- package/src/features/admin-exchange/__tests__/ImportCard.test.tsx +148 -0
- package/src/features/admin-exchange/__tests__/ImportProgress.test.tsx +106 -0
- package/src/features/admin-exchange/components/AdminExchangePage.tsx +120 -0
- package/src/features/admin-exchange/components/ExportCard.tsx +35 -0
- package/src/features/admin-exchange/components/ImportCard.tsx +188 -0
- package/src/features/admin-exchange/components/ImportProgress.tsx +86 -0
- package/src/features/admin-security/__tests__/AdminSecurityPage.test.tsx +3 -3
- package/src/features/moderate-entity-tags/__tests__/EntityTagsPage.test.tsx +2 -2
- package/src/features/moderate-recent/__tests__/RecentDocumentsPage.test.tsx +4 -4
- package/src/features/moderate-tag-schemas/__tests__/TagSchemasPage.test.tsx +3 -3
- package/src/features/moderation-linked-data/__tests__/LinkedDataPage.test.tsx +117 -0
- package/src/features/moderation-linked-data/components/LinkedDataPage.tsx +121 -0
- package/src/features/resource-compose/__tests__/ResourceComposePage.test.tsx +5 -5
- package/src/features/resource-compose/components/ResourceComposePage.tsx +56 -1
- package/src/features/resource-discovery/__tests__/ResourceCard.test.tsx +1 -1
- package/src/features/resource-discovery/__tests__/ResourceDiscoveryPage.test.tsx +2 -2
- package/src/features/resource-viewer/__tests__/AnnotationCreationPending.test.tsx +14 -14
- package/src/features/resource-viewer/__tests__/AnnotationDeletionIntegration.test.tsx +12 -11
- package/src/features/resource-viewer/__tests__/AnnotationProgressDismissal.test.tsx +2 -2
- package/src/features/resource-viewer/__tests__/BindFlowIntegration.test.tsx +22 -115
- package/src/features/resource-viewer/__tests__/DetectionFlowBug.test.tsx +3 -3
- package/src/features/resource-viewer/__tests__/DetectionFlowIntegration.test.tsx +20 -20
- package/src/features/resource-viewer/__tests__/ResourceMutations.test.tsx +7 -7
- package/src/features/resource-viewer/__tests__/ResourceViewerPage.test.tsx +43 -20
- package/src/features/resource-viewer/__tests__/ToastNotifications.test.tsx +2 -2
- package/src/features/resource-viewer/__tests__/YieldFlowIntegration.test.tsx +45 -82
- package/src/features/resource-viewer/__tests__/annotation-progress-flow.test.tsx +4 -4
- package/src/features/resource-viewer/components/ResourceViewerPage.tsx +151 -74
- package/src/integrations/tailwind-plugin.js +3 -3
- package/src/styles/core/buttons.css +31 -0
- package/src/styles/features/exchange.css +404 -0
- package/src/styles/index.css +1 -0
- package/translations/ar.json +42 -4
- package/translations/bn.json +42 -4
- package/translations/cs.json +42 -4
- package/translations/da.json +128 -90
- package/translations/de.json +122 -84
- package/translations/el.json +42 -4
- package/translations/en.json +42 -4
- package/translations/es.json +42 -4
- package/translations/fa.json +42 -4
- package/translations/fi.json +68 -30
- package/translations/fr.json +42 -4
- package/translations/he.json +42 -4
- package/translations/hi.json +42 -4
- package/translations/id.json +43 -5
- package/translations/it.json +62 -24
- package/translations/ja.json +43 -5
- package/translations/ko.json +42 -4
- package/translations/ms.json +43 -5
- package/translations/nl.json +41 -3
- package/translations/no.json +104 -66
- package/translations/pl.json +42 -4
- package/translations/pt.json +43 -5
- package/translations/ro.json +42 -4
- package/translations/sv.json +42 -4
- package/translations/th.json +42 -4
- package/translations/tr.json +42 -4
- package/translations/uk.json +42 -4
- package/translations/vi.json +42 -4
- package/translations/zh.json +42 -4
- package/dist/PdfAnnotationCanvas.client-COQREPXU.mjs.map +0 -1
- package/dist/ar-7SUXNE34.mjs.map +0 -1
- package/dist/bn-XOET3DOI.mjs.map +0 -1
- package/dist/chunk-JH7BXE2P.mjs.map +0 -1
- package/dist/cs-X63DXX7L.mjs.map +0 -1
- package/dist/da-OWTCV57A.mjs.map +0 -1
- package/dist/de-77BMFDVF.mjs.map +0 -1
- package/dist/el-FIBNLH2V.mjs.map +0 -1
- package/dist/es-726NTS53.mjs.map +0 -1
- package/dist/fa-3N4CIWE6.mjs.map +0 -1
- package/dist/fi-JOM3M7Z4.mjs.map +0 -1
- package/dist/fr-56QSXS7E.mjs.map +0 -1
- package/dist/he-SNAXPJEK.mjs.map +0 -1
- package/dist/hi-CRBRD5TB.mjs.map +0 -1
- package/dist/id-BRCVLICF.mjs.map +0 -1
- package/dist/it-M2Z27BNB.mjs.map +0 -1
- package/dist/ja-TZUKW7HD.mjs.map +0 -1
- package/dist/ko-NKBGGOL6.mjs.map +0 -1
- package/dist/ms-XFXPN6RX.mjs.map +0 -1
- package/dist/nl-MVYXAS5C.mjs.map +0 -1
- package/dist/no-XOLO4JPV.mjs.map +0 -1
- package/dist/pl-TRWLMMC4.mjs.map +0 -1
- package/dist/pt-M3TE24UI.mjs.map +0 -1
- package/dist/ro-QBFG2T64.mjs.map +0 -1
- package/dist/sv-IUECBXWX.mjs.map +0 -1
- package/dist/th-US7KIN5Q.mjs.map +0 -1
- package/dist/tr-DWJ2FFUK.mjs.map +0 -1
- package/dist/uk-M4ZE4DPZ.mjs.map +0 -1
- package/dist/zh-3J2I3WYK.mjs.map +0 -1
- package/src/examples/ButtonUsageExample.tsx +0 -242
- package/src/examples/button-css-modules.module.css +0 -164
- package/src/examples/button-styled-components.tsx +0 -215
- package/src/examples/button-tailwind.css +0 -51
- /package/dist/{chunk-Q2KV6Y2J.mjs.map → chunk-7GEYABC6.mjs.map} +0 -0
- /package/dist/{chunk-3JTO27MH.mjs.map → chunk-D4GAAQMM.mjs.map} +0 -0
- /package/dist/{en-XWEPVTB4.mjs.map → en-HAKDCFKL.mjs.map} +0 -0
- /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
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|