@torch-ui/solid 0.1.3
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/README.md +166 -0
- package/package.json +67 -0
- package/src/components/actions/Button.tsx +612 -0
- package/src/components/actions/ButtonGroup.tsx +728 -0
- package/src/components/actions/Copy.tsx +98 -0
- package/src/components/actions/DarkModeToggle.tsx +80 -0
- package/src/components/actions/Link.tsx +37 -0
- package/src/components/actions/index.ts +19 -0
- package/src/components/actions/useCopyToClipboard.ts +90 -0
- package/src/components/charts/Chart.tsx +331 -0
- package/src/components/charts/Sparkline.tsx +156 -0
- package/src/components/charts/index.ts +13 -0
- package/src/components/data-display/Avatar.tsx +208 -0
- package/src/components/data-display/AvatarGroup.tsx +228 -0
- package/src/components/data-display/Badge.tsx +70 -0
- package/src/components/data-display/Carousel.tsx +214 -0
- package/src/components/data-display/ColorSwatch.tsx +56 -0
- package/src/components/data-display/DataTable.tsx +886 -0
- package/src/components/data-display/EmptyState.tsx +61 -0
- package/src/components/data-display/Image.tsx +277 -0
- package/src/components/data-display/Kbd.tsx +114 -0
- package/src/components/data-display/Persona.tsx +78 -0
- package/src/components/data-display/StatCard.tsx +338 -0
- package/src/components/data-display/Table.tsx +147 -0
- package/src/components/data-display/Tag.tsx +91 -0
- package/src/components/data-display/Timeline.tsx +200 -0
- package/src/components/data-display/TreeView.tsx +172 -0
- package/src/components/data-display/Video.tsx +95 -0
- package/src/components/data-display/avatar-utils.ts +32 -0
- package/src/components/data-display/index.ts +81 -0
- package/src/components/feedback/Loading.tsx +159 -0
- package/src/components/feedback/Progress.tsx +321 -0
- package/src/components/feedback/Skeleton.tsx +62 -0
- package/src/components/feedback/SkeletonBlocks.tsx +222 -0
- package/src/components/feedback/Toast.tsx +648 -0
- package/src/components/feedback/index.ts +44 -0
- package/src/components/feedback/password/PasswordStrengthIndicator.tsx +232 -0
- package/src/components/feedback/password/password-strength.ts +115 -0
- package/src/components/feedback/password/password-validation-data.ts +66 -0
- package/src/components/feedback/password/password-validation.ts +93 -0
- package/src/components/forms/Autocomplete.tsx +268 -0
- package/src/components/forms/Checkbox.tsx +155 -0
- package/src/components/forms/CodeInput.tsx +237 -0
- package/src/components/forms/ColorPicker/ColorPicker.tsx +469 -0
- package/src/components/forms/ColorPicker/color-utils.ts +75 -0
- package/src/components/forms/ColorPicker/index.ts +2 -0
- package/src/components/forms/DatePicker.tsx +516 -0
- package/src/components/forms/DateRangePicker.tsx +464 -0
- package/src/components/forms/FieldPicker.tsx +64 -0
- package/src/components/forms/FileUpload.tsx +614 -0
- package/src/components/forms/FilterBuilder/FilterGroupBlock.ts +6 -0
- package/src/components/forms/FilterBuilder.tsx +16 -0
- package/src/components/forms/FilterRuleRow.tsx +68 -0
- package/src/components/forms/Input.tsx +200 -0
- package/src/components/forms/MultiSelect.tsx +361 -0
- package/src/components/forms/NumberField.tsx +145 -0
- package/src/components/forms/RadioGroup.tsx +135 -0
- package/src/components/forms/RelativeDateDefaultInput.tsx +62 -0
- package/src/components/forms/ReorderableList.tsx +163 -0
- package/src/components/forms/Select.tsx +268 -0
- package/src/components/forms/Slider.tsx +260 -0
- package/src/components/forms/Switch.tsx +135 -0
- package/src/components/forms/TextArea.tsx +202 -0
- package/src/components/forms/ViewCustomizer.tsx +44 -0
- package/src/components/forms/index.ts +43 -0
- package/src/components/layout/Accordion.tsx +110 -0
- package/src/components/layout/Alert.tsx +156 -0
- package/src/components/layout/BlockQuote.tsx +70 -0
- package/src/components/layout/Card.tsx +166 -0
- package/src/components/layout/CodeBlock/CodeBlock.tsx +477 -0
- package/src/components/layout/CodeBlock/code-block-tokens.css +104 -0
- package/src/components/layout/CodeBlock/prism.ts +81 -0
- package/src/components/layout/Collapsible.tsx +84 -0
- package/src/components/layout/Container.tsx +55 -0
- package/src/components/layout/Divider.tsx +64 -0
- package/src/components/layout/Form.tsx +39 -0
- package/src/components/layout/FormActions.tsx +50 -0
- package/src/components/layout/Grid.tsx +53 -0
- package/src/components/layout/PageHeading.tsx +46 -0
- package/src/components/layout/PromptWithAction.tsx +49 -0
- package/src/components/layout/Section.tsx +60 -0
- package/src/components/layout/TablePanel.tsx +24 -0
- package/src/components/layout/TableView/TableView.tsx +1018 -0
- package/src/components/layout/TableView/index.ts +3 -0
- package/src/components/layout/TableView/types.ts +51 -0
- package/src/components/layout/WizardStep.tsx +40 -0
- package/src/components/layout/WizardStepper.tsx +173 -0
- package/src/components/layout/index.ts +96 -0
- package/src/components/navigation/Breadcrumbs.tsx +66 -0
- package/src/components/navigation/DropdownMenu.tsx +86 -0
- package/src/components/navigation/MegaMenu.tsx +480 -0
- package/src/components/navigation/NavigationMenu.tsx +305 -0
- package/src/components/navigation/Pagination.tsx +298 -0
- package/src/components/navigation/Sidebar.tsx +280 -0
- package/src/components/navigation/Tabs.tsx +122 -0
- package/src/components/navigation/ViewSwitcher.tsx +314 -0
- package/src/components/navigation/index.ts +66 -0
- package/src/components/overlays/AlertDialog.tsx +174 -0
- package/src/components/overlays/ContextMenu.tsx +65 -0
- package/src/components/overlays/Dialog.tsx +279 -0
- package/src/components/overlays/Drawer.tsx +370 -0
- package/src/components/overlays/HoverCard.tsx +107 -0
- package/src/components/overlays/Popover.tsx +73 -0
- package/src/components/overlays/Tooltip.tsx +31 -0
- package/src/components/overlays/index.ts +71 -0
- package/src/components/typography/Code.tsx +72 -0
- package/src/components/typography/Icon.tsx +36 -0
- package/src/components/typography/index.ts +10 -0
- package/src/env.d.ts +9 -0
- package/src/index.ts +13 -0
- package/src/styles/theme.css +226 -0
- package/src/types/avatar-types.ts +11 -0
- package/src/types/filter-types.ts +35 -0
- package/src/utilities/classNames.ts +6 -0
- package/src/utilities/componentSize.ts +46 -0
- package/src/utilities/i18n.tsx +60 -0
- package/src/utilities/mergeRefs.ts +12 -0
- package/src/utilities/relativeDateDefault.ts +14 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { JSX } from 'solid-js'
|
|
2
|
+
import { splitProps } from 'solid-js'
|
|
3
|
+
import { cn } from '../../utilities/classNames'
|
|
4
|
+
|
|
5
|
+
export interface SectionProps extends Omit<JSX.HTMLAttributes<HTMLElement>, 'children'> {
|
|
6
|
+
/** Section title (e.g. h2) */
|
|
7
|
+
title?: string
|
|
8
|
+
/** Optional description below title */
|
|
9
|
+
description?: string
|
|
10
|
+
/** Optional description as JSX */
|
|
11
|
+
descriptionContent?: JSX.Element
|
|
12
|
+
/** Optional id for the section element (for anchor links / "On this page" TOC). */
|
|
13
|
+
id?: string
|
|
14
|
+
/** Optional class for the section wrapper */
|
|
15
|
+
class?: string
|
|
16
|
+
/** Optional class for the title */
|
|
17
|
+
titleClass?: string
|
|
18
|
+
/** Optional class for the description paragraph */
|
|
19
|
+
descriptionClass?: string
|
|
20
|
+
children: JSX.Element
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** Section block with optional title and description. Use for repeated content blocks (e.g. admin pages). */
|
|
24
|
+
export function Section(props: SectionProps): JSX.Element {
|
|
25
|
+
const [local, others] = splitProps(props, [
|
|
26
|
+
'title',
|
|
27
|
+
'description',
|
|
28
|
+
'descriptionContent',
|
|
29
|
+
'id',
|
|
30
|
+
'class',
|
|
31
|
+
'titleClass',
|
|
32
|
+
'descriptionClass',
|
|
33
|
+
'children',
|
|
34
|
+
'ref',
|
|
35
|
+
])
|
|
36
|
+
return (
|
|
37
|
+
<section ref={local.ref} id={local.id} class={cn(local.class)} {...others}>
|
|
38
|
+
{local.title != null && local.title !== '' && (
|
|
39
|
+
<h2
|
|
40
|
+
class={cn(
|
|
41
|
+
'mb-2 text-lg font-semibold text-ink-900',
|
|
42
|
+
local.titleClass
|
|
43
|
+
)}
|
|
44
|
+
>
|
|
45
|
+
{local.title}
|
|
46
|
+
</h2>
|
|
47
|
+
)}
|
|
48
|
+
{local.descriptionContent != null ? (
|
|
49
|
+
<div class={cn('mb-4 text-sm text-ink-500', local.descriptionClass)}>
|
|
50
|
+
{local.descriptionContent}
|
|
51
|
+
</div>
|
|
52
|
+
) : local.description != null && local.description !== '' ? (
|
|
53
|
+
<p class={cn('mb-4 text-sm text-ink-500', local.descriptionClass)}>
|
|
54
|
+
{local.description}
|
|
55
|
+
</p>
|
|
56
|
+
) : null}
|
|
57
|
+
{local.children}
|
|
58
|
+
</section>
|
|
59
|
+
)
|
|
60
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { JSX } from 'solid-js'
|
|
2
|
+
import { splitProps } from 'solid-js'
|
|
3
|
+
import { cn } from '../../utilities/classNames'
|
|
4
|
+
|
|
5
|
+
export interface TablePanelProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
header?: JSX.Element
|
|
7
|
+
headerClass?: string
|
|
8
|
+
bodyClass?: string
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function TablePanel(props: TablePanelProps) {
|
|
12
|
+
const [local, others] = splitProps(props, ['header', 'headerClass', 'bodyClass', 'class', 'children'])
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<div class={cn('rounded-2xl border border-surface-border bg-surface-raised shadow-sm', local.class)} {...others}>
|
|
16
|
+
{local.header && (
|
|
17
|
+
<div class={cn('rounded-t-2xl border-b border-surface-border p-4', local.headerClass)}>
|
|
18
|
+
{local.header}
|
|
19
|
+
</div>
|
|
20
|
+
)}
|
|
21
|
+
<div class={cn('p-4', local.bodyClass)}>{local.children}</div>
|
|
22
|
+
</div>
|
|
23
|
+
)
|
|
24
|
+
}
|