@studiocms/ui 0.0.1
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/LICENSE +21 -0
- package/README.md +564 -0
- package/package.json +49 -0
- package/src/components/BaseHead.astro +22 -0
- package/src/components/Button.astro +338 -0
- package/src/components/Card.astro +62 -0
- package/src/components/Center.astro +16 -0
- package/src/components/Checkbox.astro +180 -0
- package/src/components/Divider.astro +39 -0
- package/src/components/Dropdown/Dropdown.astro +253 -0
- package/src/components/Dropdown/dropdown.ts +170 -0
- package/src/components/Dropdown/index.ts +2 -0
- package/src/components/Input.astro +93 -0
- package/src/components/Modal/Modal.astro +164 -0
- package/src/components/Modal/index.ts +2 -0
- package/src/components/Modal/modal.ts +129 -0
- package/src/components/RadioGroup.astro +175 -0
- package/src/components/Row.astro +38 -0
- package/src/components/SearchSelect.astro +430 -0
- package/src/components/Select.astro +334 -0
- package/src/components/Sidebar/Double.astro +91 -0
- package/src/components/Sidebar/Single.astro +42 -0
- package/src/components/Sidebar/helpers.ts +133 -0
- package/src/components/Sidebar/index.ts +3 -0
- package/src/components/Textarea.astro +102 -0
- package/src/components/ThemeToggle.astro +40 -0
- package/src/components/Toast/Toaster.astro +330 -0
- package/src/components/Toast/index.ts +2 -0
- package/src/components/Toast/toast.ts +16 -0
- package/src/components/Toggle.astro +146 -0
- package/src/components/User.astro +68 -0
- package/src/components/index.ts +25 -0
- package/src/components.ts +24 -0
- package/src/css/colors.css +106 -0
- package/src/css/global.css +2 -0
- package/src/css/resets.css +55 -0
- package/src/env.d.ts +15 -0
- package/src/icons/Checkmark.astro +13 -0
- package/src/icons/ChevronUpDown.astro +13 -0
- package/src/icons/User.astro +13 -0
- package/src/icons/X-Mark.astro +13 -0
- package/src/layouts/RootLayout.astro +34 -0
- package/src/layouts/index.ts +2 -0
- package/src/layouts.ts +1 -0
- package/src/types/index.ts +11 -0
- package/src/utils/Icon.astro +41 -0
- package/src/utils/ThemeHelper.ts +127 -0
- package/src/utils/colors.ts +1 -0
- package/src/utils/generateID.ts +5 -0
- package/src/utils/headers.ts +190 -0
- package/src/utils/iconStrings.ts +29 -0
- package/src/utils/iconType.ts +3 -0
- package/src/utils/index.ts +1 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
type ValidIconString =
|
|
2
|
+
| 'check-circle'
|
|
3
|
+
| 'exclamation-triangle'
|
|
4
|
+
| 'exclamation-circle'
|
|
5
|
+
| 'information-circle'
|
|
6
|
+
| 'x-mark';
|
|
7
|
+
|
|
8
|
+
const iconStrings: Record<ValidIconString, string> = {
|
|
9
|
+
'check-circle':
|
|
10
|
+
'<svg xmlns="http://www.w3.org/2000/svg" class="%class%" width="%width%" height="%height%" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" /></svg>',
|
|
11
|
+
'exclamation-circle':
|
|
12
|
+
'<svg xmlns="http://www.w3.org/2000/svg" class="%class%" width="%width%" height="%height%" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z" /></svg>',
|
|
13
|
+
'information-circle':
|
|
14
|
+
'<svg xmlns="http://www.w3.org/2000/svg" class="%class%" width="%width%" height="%height%" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z" /></svg>',
|
|
15
|
+
'x-mark':
|
|
16
|
+
'<svg xmlns="http://www.w3.org/2000/svg" class="%class%" width="%width%" height="%height%" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12" /></svg>',
|
|
17
|
+
'exclamation-triangle':
|
|
18
|
+
'<svg xmlns="http://www.w3.org/2000/svg" class="%class%" width="%width%" height="%height%" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z" /></svg>',
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
function getIconString(icon: ValidIconString, classes: string, width: number, height: number) {
|
|
22
|
+
return iconStrings[icon]
|
|
23
|
+
.replace('%class%', classes)
|
|
24
|
+
.replace('%width%', width.toString())
|
|
25
|
+
.replace('%height%', height.toString());
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { getIconString };
|
|
29
|
+
export type { ValidIconString };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Icon } from './Icon.astro';
|