@pgcorp/ui-kit 0.1.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/LICENSE +21 -0
- package/README.md +157 -0
- package/docs/accessibility.md +27 -0
- package/docs/getting-started.md +80 -0
- package/docs/licensing.md +30 -0
- package/docs/public-api.md +39 -0
- package/docs/security.md +21 -0
- package/docs/theming.md +35 -0
- package/docs/versioning.md +23 -0
- package/index.ts +3 -0
- package/package.json +592 -0
- package/src/components/icons/_internal/generatedSputnigUiIconMarkup.ts +971 -0
- package/src/components/icons/sputnigUiIcons.ts +530 -0
- package/src/components/layout/SAppShell.vue +232 -0
- package/src/components/layout/SDockRegion.vue +200 -0
- package/src/components/layout/SResizeHandle.vue +251 -0
- package/src/components/layout/SSideMenuButton.vue +104 -0
- package/src/components/layout/SSideMenuRail.vue +47 -0
- package/src/components/layout/SStack.css +25 -0
- package/src/components/layout/SStack.vue +57 -0
- package/src/components/layout/SStatusBarShell.css +15 -0
- package/src/components/layout/SStatusBarShell.vue +26 -0
- package/src/components/layout/SWorkbenchLayout.vue +53 -0
- package/src/components/layout/SWorkbenchPanelShell.css +161 -0
- package/src/components/layout/SWorkbenchPanelShell.vue +286 -0
- package/src/components/layout/_internal/SAppBrand.css +45 -0
- package/src/components/layout/_internal/SAppBrand.vue +37 -0
- package/src/components/layout/_internal/SAppBrandContent.vue +30 -0
- package/src/components/layout/types.ts +28 -0
- package/src/components/shared/_internal/SDialogSurface.css +127 -0
- package/src/components/shared/_internal/SDialogSurface.vue +117 -0
- package/src/components/shared/_internal/SDisclosureSummary.css +92 -0
- package/src/components/shared/_internal/SDisclosureSummary.vue +121 -0
- package/src/components/shared/_internal/SListboxGroup.css +18 -0
- package/src/components/shared/_internal/SListboxGroup.vue +24 -0
- package/src/components/shared/_internal/SMenuItem.css +112 -0
- package/src/components/shared/_internal/SMenuItem.vue +213 -0
- package/src/components/shared/_internal/SMenuLayer.css +21 -0
- package/src/components/shared/_internal/SMenuLayer.vue +48 -0
- package/src/components/shared/_internal/SMenuSeparator.css +5 -0
- package/src/components/shared/_internal/SMenuSeparator.vue +13 -0
- package/src/components/shared/_internal/SToastItem.css +65 -0
- package/src/components/shared/_internal/SToastItem.vue +58 -0
- package/src/components/shared/_internal/STreeNode.vue +761 -0
- package/src/components/shared/_internal/dialogSurface.ts +105 -0
- package/src/components/shared/_internal/focusTrap.ts +40 -0
- package/src/components/shared/_internal/listboxContext.ts +16 -0
- package/src/components/shared/_internal/markerContract.ts +10 -0
- package/src/components/shared/_internal/menuContext.ts +23 -0
- package/src/components/shared/_internal/selectionContract.ts +239 -0
- package/src/components/shared/_internal/sidebarGroupContext.ts +31 -0
- package/src/components/shared/_internal/tabsContext.ts +57 -0
- package/src/components/shared/_internal/treeRuntime.ts +203 -0
- package/src/components/shared/_internal/useSelectionRoving.ts +162 -0
- package/src/components/shared/codeLanguages.ts +168 -0
- package/src/components/shared/complex/SKanbanCard.css +8 -0
- package/src/components/shared/complex/SKanbanCard.vue +76 -0
- package/src/components/shared/complex/SKanbanLane.vue +82 -0
- package/src/components/shared/complex/STree.css +24 -0
- package/src/components/shared/complex/STree.vue +288 -0
- package/src/components/shared/complex/treeAdapter.ts +210 -0
- package/src/components/shared/complex/types.ts +102 -0
- package/src/components/shared/containers/SCloudChrome.css +103 -0
- package/src/components/shared/containers/SCloudChrome.vue +87 -0
- package/src/components/shared/containers/SCloudChromeEmpty.css +10 -0
- package/src/components/shared/containers/SCloudChromeEmpty.vue +18 -0
- package/src/components/shared/containers/SCloudChromeRow.css +78 -0
- package/src/components/shared/containers/SCloudChromeRow.vue +108 -0
- package/src/components/shared/containers/SCollapsiblePanel.css +57 -0
- package/src/components/shared/containers/SCollapsiblePanel.vue +360 -0
- package/src/components/shared/containers/SDrawer.css +60 -0
- package/src/components/shared/containers/SDrawer.vue +86 -0
- package/src/components/shared/containers/SFormGrid.css +26 -0
- package/src/components/shared/containers/SFormGrid.vue +46 -0
- package/src/components/shared/containers/SFormGridItem.css +18 -0
- package/src/components/shared/containers/SFormGridItem.vue +29 -0
- package/src/components/shared/containers/SLeftSidebar.vue +74 -0
- package/src/components/shared/containers/SModal.css +27 -0
- package/src/components/shared/containers/SModal.vue +105 -0
- package/src/components/shared/containers/SPageHeader.css +66 -0
- package/src/components/shared/containers/SPageHeader.vue +45 -0
- package/src/components/shared/containers/SPanel.css +134 -0
- package/src/components/shared/containers/SPanel.vue +169 -0
- package/src/components/shared/containers/SPopover.css +35 -0
- package/src/components/shared/containers/SPopover.vue +551 -0
- package/src/components/shared/containers/SSidebarGroup.css +12 -0
- package/src/components/shared/containers/SSidebarGroup.vue +443 -0
- package/src/components/shared/containers/SSidebarSection.css +41 -0
- package/src/components/shared/containers/SSidebarSection.vue +268 -0
- package/src/components/shared/containers/disclosureSummary.ts +48 -0
- package/src/components/shared/containers/popover.ts +72 -0
- package/src/components/shared/containers/sidebar.ts +206 -0
- package/src/components/shared/controls/SButton.css +274 -0
- package/src/components/shared/controls/SButton.vue +211 -0
- package/src/components/shared/controls/SCheckbox.css +65 -0
- package/src/components/shared/controls/SCheckbox.vue +130 -0
- package/src/components/shared/controls/SCheckboxGroup.vue +134 -0
- package/src/components/shared/controls/SChoiceCards.css +29 -0
- package/src/components/shared/controls/SChoiceCards.vue +145 -0
- package/src/components/shared/controls/SColorSelect.vue +146 -0
- package/src/components/shared/controls/SComboboxTrigger.css +35 -0
- package/src/components/shared/controls/SComboboxTrigger.vue +122 -0
- package/src/components/shared/controls/SContextMenu.css +11 -0
- package/src/components/shared/controls/SContextMenu.vue +186 -0
- package/src/components/shared/controls/SContextToggleButton.vue +64 -0
- package/src/components/shared/controls/SDragHandle.vue +100 -0
- package/src/components/shared/controls/SDropdownMenu.css +5 -0
- package/src/components/shared/controls/SDropdownMenu.vue +188 -0
- package/src/components/shared/controls/SField.css +79 -0
- package/src/components/shared/controls/SField.vue +89 -0
- package/src/components/shared/controls/SFieldGroup.css +58 -0
- package/src/components/shared/controls/SFieldGroup.vue +117 -0
- package/src/components/shared/controls/SFieldLabel.css +12 -0
- package/src/components/shared/controls/SFieldLabel.vue +51 -0
- package/src/components/shared/controls/SInlineTokenEditor.css +61 -0
- package/src/components/shared/controls/SInlineTokenEditor.vue +1081 -0
- package/src/components/shared/controls/SInputText.css +66 -0
- package/src/components/shared/controls/SInputText.vue +321 -0
- package/src/components/shared/controls/SInteractiveSurface.css +72 -0
- package/src/components/shared/controls/SInteractiveSurface.vue +326 -0
- package/src/components/shared/controls/SLink.css +114 -0
- package/src/components/shared/controls/SLink.ts +85 -0
- package/src/components/shared/controls/SLink.vue +114 -0
- package/src/components/shared/controls/SListbox.css +31 -0
- package/src/components/shared/controls/SListbox.vue +388 -0
- package/src/components/shared/controls/SListboxOption.css +63 -0
- package/src/components/shared/controls/SListboxOption.vue +85 -0
- package/src/components/shared/controls/SMarker.css +19 -0
- package/src/components/shared/controls/SMarker.vue +33 -0
- package/src/components/shared/controls/SMenuSurface.css +20 -0
- package/src/components/shared/controls/SMenuSurface.vue +333 -0
- package/src/components/shared/controls/SSegmentedControl.css +38 -0
- package/src/components/shared/controls/SSegmentedControl.vue +134 -0
- package/src/components/shared/controls/SSelect.css +12 -0
- package/src/components/shared/controls/SSelect.vue +338 -0
- package/src/components/shared/controls/STextarea.css +31 -0
- package/src/components/shared/controls/STextarea.vue +316 -0
- package/src/components/shared/controls/_internal/SInlineTokenSurface.vue +224 -0
- package/src/components/shared/controls/menu.ts +178 -0
- package/src/components/shared/data-display/SActionCard.css +6 -0
- package/src/components/shared/data-display/SActionCard.vue +49 -0
- package/src/components/shared/data-display/SActionList.css +15 -0
- package/src/components/shared/data-display/SActionList.vue +34 -0
- package/src/components/shared/data-display/SActionListItem.css +114 -0
- package/src/components/shared/data-display/SActionListItem.vue +230 -0
- package/src/components/shared/data-display/SBadge.css +73 -0
- package/src/components/shared/data-display/SBadge.vue +52 -0
- package/src/components/shared/data-display/SCodeBlock.css +56 -0
- package/src/components/shared/data-display/SCodeBlock.vue +188 -0
- package/src/components/shared/data-display/SCodeEditor.css +178 -0
- package/src/components/shared/data-display/SCodeEditor.vue +274 -0
- package/src/components/shared/data-display/SCodeSearchPanel.vue +327 -0
- package/src/components/shared/data-display/SCopyField.vue +77 -0
- package/src/components/shared/data-display/SDocBlock.css +136 -0
- package/src/components/shared/data-display/SDocBlock.vue +358 -0
- package/src/components/shared/data-display/SEmptyState.css +42 -0
- package/src/components/shared/data-display/SEmptyState.vue +79 -0
- package/src/components/shared/data-display/SExpandableText.vue +314 -0
- package/src/components/shared/data-display/SJsonTree.css +6 -0
- package/src/components/shared/data-display/SJsonTree.vue +111 -0
- package/src/components/shared/data-display/SKeyValueGrid.css +37 -0
- package/src/components/shared/data-display/SKeyValueGrid.vue +277 -0
- package/src/components/shared/data-display/SLinkedSystemsList.vue +270 -0
- package/src/components/shared/data-display/SMessage.css +88 -0
- package/src/components/shared/data-display/SMessage.vue +152 -0
- package/src/components/shared/data-display/SMetricCard.css +32 -0
- package/src/components/shared/data-display/SMetricCard.vue +117 -0
- package/src/components/shared/data-display/SProgressBar.css +84 -0
- package/src/components/shared/data-display/SProgressBar.vue +114 -0
- package/src/components/shared/data-display/SProgressIndicator.css +59 -0
- package/src/components/shared/data-display/SProgressIndicator.vue +104 -0
- package/src/components/shared/data-display/SSectionHeader.css +84 -0
- package/src/components/shared/data-display/SSectionHeader.vue +58 -0
- package/src/components/shared/data-display/SStatus.css +90 -0
- package/src/components/shared/data-display/SStatus.vue +79 -0
- package/src/components/shared/data-display/STable.css +83 -0
- package/src/components/shared/data-display/STable.vue +339 -0
- package/src/components/shared/data-display/SToastContainer.css +53 -0
- package/src/components/shared/data-display/SToastContainer.vue +31 -0
- package/src/components/shared/data-display/STooltip.css +114 -0
- package/src/components/shared/data-display/STooltip.vue +550 -0
- package/src/components/shared/data-display/STooltipAnchor.css +21 -0
- package/src/components/shared/data-display/STooltipAnchor.vue +119 -0
- package/src/components/shared/data-display/SVirtualList.css +24 -0
- package/src/components/shared/data-display/SVirtualList.ts +19 -0
- package/src/components/shared/data-display/SVirtualList.vue +361 -0
- package/src/components/shared/data-display/json.ts +136 -0
- package/src/components/shared/data-display/table.ts +76 -0
- package/src/components/shared/database/SDataGrid.css +3 -0
- package/src/components/shared/database/SDataGrid.vue +464 -0
- package/src/components/shared/database/SSqlEditor.vue +363 -0
- package/src/components/shared/database/dataGrid.ts +61 -0
- package/src/components/shared/feedback/SAsyncState.css +26 -0
- package/src/components/shared/feedback/SAsyncState.vue +190 -0
- package/src/components/shared/graph/SGraphViewport.ts +1 -0
- package/src/components/shared/graph/SGraphViewport.vue +858 -0
- package/src/components/shared/graph/_internal/graphViewportContract.ts +362 -0
- package/src/components/shared/markdown.ts +169 -0
- package/src/components/shared/navigation/SBottomNav.vue +692 -0
- package/src/components/shared/navigation/SBreadcrumbs.css +26 -0
- package/src/components/shared/navigation/SBreadcrumbs.vue +155 -0
- package/src/components/shared/navigation/SCatalogNavigator.css +100 -0
- package/src/components/shared/navigation/SCatalogNavigator.vue +308 -0
- package/src/components/shared/navigation/STab.vue +363 -0
- package/src/components/shared/navigation/STabList.vue +442 -0
- package/src/components/shared/navigation/STabPanel.vue +165 -0
- package/src/components/shared/navigation/STabPanels.vue +33 -0
- package/src/components/shared/navigation/STabs.vue +617 -0
- package/src/components/shared/navigation/SWizardSteps.css +69 -0
- package/src/components/shared/navigation/SWizardSteps.vue +171 -0
- package/src/components/shared/navigation/_internal/SCatalogNavigatorGroup.vue +63 -0
- package/src/components/shared/persona/SPersonaProjectPicker.css +36 -0
- package/src/components/shared/persona/SPersonaProjectPicker.vue +361 -0
- package/src/components/shared/persona/SPersonaRunWorkbench.css +109 -0
- package/src/components/shared/persona/SPersonaRunWorkbench.vue +549 -0
- package/src/components/shared/persona/_internal/SPersonaRunConsole.css +40 -0
- package/src/components/shared/persona/_internal/SPersonaRunConsole.vue +298 -0
- package/src/components/shared/persona/_internal/inventory.ts +110 -0
- package/src/components/shared/persona/_internal/labels.ts +79 -0
- package/src/components/shared/persona/presentation.ts +371 -0
- package/src/components/shared/persona/types.ts +256 -0
- package/src/composables/uiPreferencesReset.ts +52 -0
- package/src/composables/useClipboard.ts +37 -0
- package/src/composables/useDialogOverlay.ts +85 -0
- package/src/composables/useDisclosure.ts +40 -0
- package/src/composables/useFloatingPosition.ts +245 -0
- package/src/composables/useNotifier.ts +26 -0
- package/src/composables/useSidebarPanelState.ts +610 -0
- package/src/internal/codeEditorContract.ts +110 -0
- package/src/internal/codeEditorExtensions.ts +27 -0
- package/src/internal/feedbackPresentation.ts +136 -0
- package/src/internal/fieldSurface.ts +59 -0
- package/src/internal/focusNavigation.ts +69 -0
- package/src/internal/inlineTokenEditorContract.ts +136 -0
- package/src/internal/interactiveElement.ts +33 -0
- package/src/internal/layerStack.ts +202 -0
- package/src/internal/linkTarget.ts +256 -0
- package/src/internal/ownedAttrs.ts +464 -0
- package/src/internal/passiveContentContract.ts +129 -0
- package/src/internal/pointerInteractionLease.ts +81 -0
- package/src/internal/runtimeContract.ts +194 -0
- package/src/internal/runtimeTheme.ts +159 -0
- package/src/internal/semanticSizing.ts +60 -0
- package/src/internal/useMenuLayer.ts +129 -0
- package/src/stores/useNotifierStore.ts +69 -0
- package/src/styles/reference.css +4 -0
- package/src/styles/style.css +151 -0
- package/src/styles/tokens.css +836 -0
- package/src/theme.ts +449 -0
- package/src/types/highlight-js-lib.d.ts +76 -0
- package/src/variants.ts +15 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
@reference "../../../styles/reference.css";
|
|
2
|
+
|
|
3
|
+
.s-section-header {
|
|
4
|
+
@apply flex min-w-0 flex-wrap items-start justify-between gap-3;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.s-section-header[data-spacing-after='sm'] {
|
|
8
|
+
@apply mb-2;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.s-section-header[data-spacing-after='md'] {
|
|
12
|
+
@apply mb-3;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.s-section-header[data-divider='true'] {
|
|
16
|
+
@apply border-b border-surface-200 pb-3 dark:border-surface-700;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.s-section-header[data-padding='sm'] {
|
|
20
|
+
@apply p-2;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.s-section-header[data-padding='md'] {
|
|
24
|
+
@apply p-4;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.s-section-header[data-divider='true'][data-padding='sm'] {
|
|
28
|
+
@apply pb-2;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.s-section-header[data-divider='true'][data-padding='md'] {
|
|
32
|
+
@apply pb-4;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.s-section-header__copy {
|
|
36
|
+
@apply min-w-0 flex-1;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.s-section-header__eyebrow {
|
|
40
|
+
@apply text-xs font-semibold uppercase text-surface-500 dark:text-surface-400;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.s-section-header__title {
|
|
44
|
+
@apply m-0 break-words text-base font-semibold text-surface-900 dark:text-surface-50;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.s-section-header[data-size='sm'] .s-section-header__title {
|
|
48
|
+
@apply text-sm;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.s-section-header[data-variant='display'] .s-section-header__title {
|
|
52
|
+
@apply text-xl font-semibold uppercase tracking-[0.22em] text-surface-700 dark:text-surface-200;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.s-section-header__eyebrow + .s-section-header__title {
|
|
56
|
+
@apply mt-1;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.s-section-header__description,
|
|
60
|
+
.s-section-header__meta {
|
|
61
|
+
@apply mt-1 min-w-0 break-words text-xs text-surface-500 dark:text-surface-400;
|
|
62
|
+
overflow-wrap: anywhere;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.s-section-header__trailing {
|
|
66
|
+
@apply flex min-w-0 flex-wrap items-center justify-end gap-2;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.s-section-header__badges,
|
|
70
|
+
.s-section-header__actions {
|
|
71
|
+
@apply flex min-w-0 flex-wrap items-center justify-end gap-2;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.s-section-header[data-trailing-layout='stacked'] .s-section-header__trailing,
|
|
75
|
+
.s-section-header[data-trailing-layout='stacked'] .s-section-header__actions {
|
|
76
|
+
@apply w-full justify-start;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
@media (max-width: 639px) {
|
|
80
|
+
.s-section-header[data-trailing-layout='responsive'] .s-section-header__trailing,
|
|
81
|
+
.s-section-header[data-trailing-layout='responsive'] .s-section-header__actions {
|
|
82
|
+
@apply w-full justify-start;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useOwnedAttrs } from '../../../internal/ownedAttrs'
|
|
3
|
+
|
|
4
|
+
defineOptions({ inheritAttrs: false })
|
|
5
|
+
|
|
6
|
+
withDefaults(defineProps<{
|
|
7
|
+
title: string
|
|
8
|
+
eyebrow?: string | null
|
|
9
|
+
description?: string | null
|
|
10
|
+
meta?: string | null
|
|
11
|
+
headingLevel?: 2 | 3 | 4
|
|
12
|
+
size?: 'sm' | 'md'
|
|
13
|
+
variant?: 'default' | 'display'
|
|
14
|
+
divider?: boolean
|
|
15
|
+
padding?: 'none' | 'sm' | 'md'
|
|
16
|
+
spacingAfter?: 'none' | 'sm' | 'md'
|
|
17
|
+
trailingLayout?: 'responsive' | 'inline' | 'stacked'
|
|
18
|
+
}>(), {
|
|
19
|
+
eyebrow: undefined,
|
|
20
|
+
description: undefined,
|
|
21
|
+
meta: undefined,
|
|
22
|
+
headingLevel: 3,
|
|
23
|
+
size: 'md',
|
|
24
|
+
variant: 'default',
|
|
25
|
+
divider: false,
|
|
26
|
+
padding: 'none',
|
|
27
|
+
spacingAfter: 'none',
|
|
28
|
+
trailingLayout: 'responsive',
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
const ownedAttrs = useOwnedAttrs({ component: 'SSectionHeader', owner: 'section header root' })
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<template>
|
|
35
|
+
<header
|
|
36
|
+
v-bind="ownedAttrs.bindings()"
|
|
37
|
+
class="s-section-header"
|
|
38
|
+
:data-size="size"
|
|
39
|
+
:data-variant="variant"
|
|
40
|
+
:data-divider="divider || undefined"
|
|
41
|
+
:data-padding="padding"
|
|
42
|
+
:data-spacing-after="spacingAfter"
|
|
43
|
+
:data-trailing-layout="trailingLayout"
|
|
44
|
+
>
|
|
45
|
+
<div class="s-section-header__copy">
|
|
46
|
+
<div v-if="eyebrow" class="s-section-header__eyebrow">{{ eyebrow }}</div>
|
|
47
|
+
<component :is="`h${headingLevel}`" class="s-section-header__title">{{ title }}</component>
|
|
48
|
+
<p v-if="description" class="s-section-header__description">{{ description }}</p>
|
|
49
|
+
<p v-if="meta" class="s-section-header__meta">{{ meta }}</p>
|
|
50
|
+
</div>
|
|
51
|
+
<div v-if="$slots.badges || $slots.actions" class="s-section-header__trailing">
|
|
52
|
+
<div v-if="$slots.badges" class="s-section-header__badges"><slot name="badges" /></div>
|
|
53
|
+
<div v-if="$slots.actions" class="s-section-header__actions"><slot name="actions" /></div>
|
|
54
|
+
</div>
|
|
55
|
+
</header>
|
|
56
|
+
</template>
|
|
57
|
+
|
|
58
|
+
<style lang="postcss" src="./SSectionHeader.css" scoped></style>
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
@reference "../../../styles/reference.css";
|
|
2
|
+
|
|
3
|
+
.s-status {
|
|
4
|
+
@apply inline-flex min-w-0 items-center font-medium;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.s-status[data-size='xs'] {
|
|
8
|
+
@apply gap-1 text-[10px] leading-4;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.s-status[data-size='sm'] {
|
|
12
|
+
@apply gap-1.5 text-xs leading-4;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.s-status[data-size='md'] {
|
|
16
|
+
@apply gap-1.5 text-sm leading-5;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.s-status[data-appearance='soft'] {
|
|
20
|
+
@apply rounded-full border px-2 py-0.5;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.s-status__icon {
|
|
24
|
+
@apply inline-flex shrink-0 items-center justify-center;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.s-status[data-size='xs'] .s-status__icon {
|
|
28
|
+
@apply h-3 w-3;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.s-status[data-size='sm'] .s-status__icon {
|
|
32
|
+
@apply h-3.5 w-3.5;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.s-status[data-size='md'] .s-status__icon {
|
|
36
|
+
@apply h-4 w-4;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.s-status__icon-graphic {
|
|
40
|
+
@apply h-full w-full;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.s-status__label {
|
|
44
|
+
@apply min-w-0;
|
|
45
|
+
overflow-wrap: anywhere;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.s-status[data-label-visibility='sr-only'] .s-status__label {
|
|
49
|
+
@apply sr-only;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.s-status[data-tone='neutral'] {
|
|
53
|
+
@apply text-surface-500 dark:text-surface-400;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.s-status[data-tone='info'] {
|
|
57
|
+
@apply text-info-700 dark:text-info-300;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.s-status[data-tone='success'] {
|
|
61
|
+
@apply text-success-700 dark:text-success-300;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.s-status[data-tone='warn'] {
|
|
65
|
+
@apply text-warn-700 dark:text-warn-300;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.s-status[data-tone='danger'] {
|
|
69
|
+
@apply text-danger-700 dark:text-danger-300;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.s-status[data-appearance='soft'][data-tone='neutral'] {
|
|
73
|
+
@apply border-surface-200 bg-surface-100 dark:border-surface-700 dark:bg-surface-800;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.s-status[data-appearance='soft'][data-tone='info'] {
|
|
77
|
+
@apply border-info-200 bg-info-50 dark:border-info-800 dark:bg-info-950;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.s-status[data-appearance='soft'][data-tone='success'] {
|
|
81
|
+
@apply border-success-200 bg-success-50 dark:border-success-800 dark:bg-success-950;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.s-status[data-appearance='soft'][data-tone='warn'] {
|
|
85
|
+
@apply border-warn-200 bg-warn-50 dark:border-warn-800 dark:bg-warn-950;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.s-status[data-appearance='soft'][data-tone='danger'] {
|
|
89
|
+
@apply border-danger-200 bg-danger-50 dark:border-danger-800 dark:bg-danger-950;
|
|
90
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span
|
|
3
|
+
v-bind="ownedAttrs.bindings()"
|
|
4
|
+
class="s-status"
|
|
5
|
+
:data-tone="tone"
|
|
6
|
+
:data-appearance="appearance"
|
|
7
|
+
:data-size="size"
|
|
8
|
+
:data-label-visibility="labelVisibility"
|
|
9
|
+
:title="title"
|
|
10
|
+
:role="liveAttributes.role"
|
|
11
|
+
:aria-live="liveAttributes.ariaLive"
|
|
12
|
+
:aria-atomic="liveAttributes.ariaAtomic"
|
|
13
|
+
data-testid="s-status"
|
|
14
|
+
>
|
|
15
|
+
<span v-if="resolvedIcon" class="s-status__icon" aria-hidden="true">
|
|
16
|
+
<component :is="resolvedIcon" class="s-status__icon-graphic" />
|
|
17
|
+
</span>
|
|
18
|
+
<span class="s-status__label">{{ label }}</span>
|
|
19
|
+
</span>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script setup lang="ts">
|
|
23
|
+
import { computed, markRaw, toRaw, type Component } from 'vue'
|
|
24
|
+
import { useOwnedAttrs } from '../../../internal/ownedAttrs'
|
|
25
|
+
|
|
26
|
+
import {
|
|
27
|
+
resolveFeedbackLive,
|
|
28
|
+
resolveFeedbackPresentation,
|
|
29
|
+
type FeedbackLiveMode,
|
|
30
|
+
type FeedbackTone,
|
|
31
|
+
} from '../../../internal/feedbackPresentation'
|
|
32
|
+
|
|
33
|
+
defineOptions({ inheritAttrs: false })
|
|
34
|
+
|
|
35
|
+
export type StatusTone = FeedbackTone
|
|
36
|
+
export type StatusAppearance = 'text' | 'soft'
|
|
37
|
+
export type StatusSize = 'xs' | 'sm' | 'md'
|
|
38
|
+
export type StatusLiveMode = Exclude<FeedbackLiveMode, 'auto'>
|
|
39
|
+
|
|
40
|
+
export interface StatusPresentation {
|
|
41
|
+
label: string
|
|
42
|
+
tone?: StatusTone
|
|
43
|
+
title?: string
|
|
44
|
+
icon?: Component | null
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const props = withDefaults(defineProps<{
|
|
48
|
+
label: string
|
|
49
|
+
tone?: StatusTone
|
|
50
|
+
appearance?: StatusAppearance
|
|
51
|
+
size?: StatusSize
|
|
52
|
+
/** Видимость текстовой подписи при сохранении accessible name. / Text-label visibility while preserving the accessible name. */
|
|
53
|
+
labelVisibility?: 'visible' | 'sr-only'
|
|
54
|
+
title?: string
|
|
55
|
+
icon?: Component | null
|
|
56
|
+
live?: StatusLiveMode
|
|
57
|
+
}>(), {
|
|
58
|
+
tone: 'neutral',
|
|
59
|
+
appearance: 'text',
|
|
60
|
+
size: 'md',
|
|
61
|
+
labelVisibility: 'visible',
|
|
62
|
+
title: undefined,
|
|
63
|
+
icon: undefined,
|
|
64
|
+
live: 'off',
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
const defaultIcon = computed<Component>(() => resolveFeedbackPresentation(props.tone).icon)
|
|
68
|
+
const ownedAttrs = useOwnedAttrs({ component: 'SStatus', owner: 'status root' })
|
|
69
|
+
const liveAttributes = computed(() => resolveFeedbackLive(props.tone, props.live))
|
|
70
|
+
|
|
71
|
+
const resolvedIcon = computed<Component | null>(() => {
|
|
72
|
+
if (props.icon === null) {
|
|
73
|
+
return null
|
|
74
|
+
}
|
|
75
|
+
return markRaw(toRaw(props.icon ?? defaultIcon.value) as Component)
|
|
76
|
+
})
|
|
77
|
+
</script>
|
|
78
|
+
|
|
79
|
+
<style lang="postcss" src="./SStatus.css" scoped></style>
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
@reference "../../../styles/reference.css";
|
|
2
|
+
|
|
3
|
+
.s-table-wrapper {
|
|
4
|
+
@apply w-full min-w-0 overflow-auto rounded-lg border border-surface-200 bg-surface-0;
|
|
5
|
+
@apply dark:border-surface-700 dark:bg-surface-800;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.s-table-wrapper[data-surface="plain"] {
|
|
9
|
+
@apply rounded-none border-0 bg-transparent dark:bg-transparent;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.s-table-wrapper[data-max-height="sm"] { max-block-size: var(--s-scroll-viewport-max-block-size-sm); }
|
|
13
|
+
.s-table-wrapper[data-max-height="md"] { max-block-size: var(--s-scroll-viewport-max-block-size-md); }
|
|
14
|
+
.s-table-wrapper[data-max-height="lg"] { max-block-size: var(--s-scroll-viewport-max-block-size-lg); }
|
|
15
|
+
|
|
16
|
+
.s-table {
|
|
17
|
+
@apply min-w-full border-collapse text-left text-sm;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.s-table-wrapper[data-min-width="md"] .s-table {
|
|
21
|
+
min-inline-size: var(--s-table-inline-size-md);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.s-table-wrapper[data-min-width="lg"] .s-table {
|
|
25
|
+
min-inline-size: var(--s-table-inline-size-lg);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.s-table-header th {
|
|
29
|
+
@apply sticky top-0 border-b border-surface-200 bg-surface-50 px-4 py-3;
|
|
30
|
+
z-index: var(--s-layer-sticky);
|
|
31
|
+
min-height: var(--s-density-row-comfortable);
|
|
32
|
+
@apply text-xs font-semibold uppercase tracking-wider text-surface-500;
|
|
33
|
+
@apply dark:border-surface-700 dark:bg-surface-800 dark:text-surface-400;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.s-table-header th[data-width="auto"] { inline-size: auto; }
|
|
37
|
+
.s-table-header th[data-width="xs"] { inline-size: var(--s-table-column-inline-size-xs); }
|
|
38
|
+
.s-table-header th[data-width="sm"] { inline-size: var(--s-table-column-inline-size-sm); }
|
|
39
|
+
.s-table-header th[data-width="md"] { inline-size: var(--s-table-column-inline-size-md); }
|
|
40
|
+
.s-table-header th[data-width="lg"] { inline-size: var(--s-table-column-inline-size-lg); }
|
|
41
|
+
.s-table-header th[data-width="xl"] { inline-size: var(--s-table-column-inline-size-xl); }
|
|
42
|
+
.s-table-header th[data-width="fill"] { inline-size: 100%; }
|
|
43
|
+
.s-table-header th[data-min-width="xs"] { min-inline-size: var(--s-table-column-inline-size-xs); }
|
|
44
|
+
.s-table-header th[data-min-width="sm"] { min-inline-size: var(--s-table-column-inline-size-sm); }
|
|
45
|
+
.s-table-header th[data-min-width="md"] { min-inline-size: var(--s-table-column-inline-size-md); }
|
|
46
|
+
.s-table-header th[data-min-width="lg"] { min-inline-size: var(--s-table-column-inline-size-lg); }
|
|
47
|
+
.s-table-header th[data-min-width="xl"] { min-inline-size: var(--s-table-column-inline-size-xl); }
|
|
48
|
+
|
|
49
|
+
.s-table-body tr {
|
|
50
|
+
@apply border-b border-surface-100 dark:border-surface-700/50;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.s-table-body tr:last-child {
|
|
54
|
+
@apply border-b-0;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.s-table-body tr:hover {
|
|
58
|
+
@apply bg-surface-50/50 dark:bg-surface-800/20;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.s-table-body td {
|
|
62
|
+
@apply px-4 py-3 align-middle text-surface-700 dark:text-surface-300;
|
|
63
|
+
height: var(--s-density-row-comfortable);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.s-table[data-density="compact"] th { @apply px-3 py-2; }
|
|
67
|
+
.s-table[data-density="compact"] td { @apply px-2 py-1.5; height: var(--s-density-row-compact); }
|
|
68
|
+
|
|
69
|
+
.s-table [data-align="center"] { text-align: center; }
|
|
70
|
+
.s-table [data-align="right"] { text-align: right; }
|
|
71
|
+
|
|
72
|
+
.s-table-body tr[data-state="inserted"] td {
|
|
73
|
+
@apply bg-success-50 dark:bg-success-950/25;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.s-table-body tr[data-state="updated"] td,
|
|
77
|
+
.s-table-body td[data-state="pending"] {
|
|
78
|
+
@apply bg-primary-50 dark:bg-primary-950/25;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.s-table-body tr[data-state="deleted"] td {
|
|
82
|
+
@apply bg-danger-50 text-danger-700 line-through dark:bg-danger-950/25 dark:text-danger-300;
|
|
83
|
+
}
|