@mks2508/mks-ui 0.5.4 → 0.5.8
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/react-ui/primitives/waapi/Gooey/Gooey.types.d.ts +23 -4
- package/dist/react-ui/primitives/waapi/Gooey/Gooey.types.d.ts.map +1 -1
- package/dist/react-ui/primitives/waapi/Gooey/GooeyCanvas.d.ts +2 -2
- package/dist/react-ui/primitives/waapi/Gooey/GooeyCanvas.d.ts.map +1 -1
- package/dist/react-ui/primitives/waapi/Gooey/GooeyCanvas.js +292 -31
- package/dist/react-ui/primitives/waapi/Gooey/gooey-utils.d.ts +7 -0
- package/dist/react-ui/primitives/waapi/Gooey/gooey-utils.d.ts.map +1 -1
- package/dist/react-ui/primitives/waapi/Gooey/gooey-utils.js +6 -1
- package/dist/react-ui/ui/DynamicToggle/{DynamicToggle-Cm6-VceQ.css → DynamicToggle-DJLwEkHr.css} +116 -51
- package/dist/react-ui/ui/DynamicToggle/DynamicToggle.css +116 -51
- package/dist/react-ui/ui/DynamicToggle/DynamicToggle.styles.d.ts +1 -0
- package/dist/react-ui/ui/DynamicToggle/DynamicToggle.styles.d.ts.map +1 -1
- package/dist/react-ui/ui/DynamicToggle/DynamicToggle.styles.js +9 -3
- package/dist/react-ui/ui/DynamicToggle/DynamicToggle.types.d.ts +61 -31
- package/dist/react-ui/ui/DynamicToggle/DynamicToggle.types.d.ts.map +1 -1
- package/dist/react-ui/ui/DynamicToggle/index.d.ts +9 -3
- package/dist/react-ui/ui/DynamicToggle/index.d.ts.map +1 -1
- package/dist/react-ui/ui/DynamicToggle/index.js +68 -37
- package/package.json +52 -13
- package/src/assets/react.svg +0 -1
- package/src/core/index.ts +0 -7
- package/src/core/types.ts +0 -82
- package/src/css.d.ts +0 -7
- package/src/index.css +0 -129
- package/src/index.ts +0 -29
- package/src/react-ui/blocks/Terminal/ResttyAdapter.ts +0 -278
- package/src/react-ui/blocks/Terminal/Terminal.adapter.ts +0 -97
- package/src/react-ui/blocks/Terminal/Terminal.theme.restty.ts +0 -155
- package/src/react-ui/blocks/Terminal/Terminal.theme.ts +0 -80
- package/src/react-ui/blocks/Terminal/Terminal.types.ts +0 -438
- package/src/react-ui/blocks/Terminal/TerminalDisplay.styles.ts +0 -38
- package/src/react-ui/blocks/Terminal/TerminalDisplay.tsx +0 -254
- package/src/react-ui/blocks/Terminal/TerminalDisplay.types.ts +0 -73
- package/src/react-ui/blocks/Terminal/TerminalPanel.tsx +0 -269
- package/src/react-ui/blocks/Terminal/TerminalRestty.tsx +0 -326
- package/src/react-ui/blocks/Terminal/TerminalXterm.tsx +0 -230
- package/src/react-ui/blocks/Terminal/XTermAdapter.ts +0 -163
- package/src/react-ui/blocks/Terminal/chrome.ts +0 -25
- package/src/react-ui/blocks/Terminal/components/LogLineBadges.tsx +0 -316
- package/src/react-ui/blocks/Terminal/components/SpecializedSyntaxHighlighter.tsx +0 -218
- package/src/react-ui/blocks/Terminal/components/SyntaxHighlight.tsx +0 -386
- package/src/react-ui/blocks/Terminal/components/TerminalLogBadge.tsx +0 -67
- package/src/react-ui/blocks/Terminal/components/index.ts +0 -10
- package/src/react-ui/blocks/Terminal/display.ts +0 -46
- package/src/react-ui/blocks/Terminal/hooks/index.ts +0 -22
- package/src/react-ui/blocks/Terminal/hooks/useTerminalSettings.ts +0 -229
- package/src/react-ui/blocks/Terminal/hooks/useTerminalWebSocket.ts +0 -292
- package/src/react-ui/blocks/Terminal/index.ts +0 -111
- package/src/react-ui/blocks/Terminal/panel/LogLinesViewer.tsx +0 -330
- package/src/react-ui/blocks/Terminal/panel/TerminalDebugPanel.tsx +0 -242
- package/src/react-ui/blocks/Terminal/panel/TerminalFilterDropdown.tsx +0 -202
- package/src/react-ui/blocks/Terminal/panel/TerminalFilterTabs.tsx +0 -140
- package/src/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.tsx +0 -68
- package/src/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.types.ts +0 -85
- package/src/react-ui/blocks/Terminal/panel/TerminalInteractivePanelRestty.tsx +0 -383
- package/src/react-ui/blocks/Terminal/panel/TerminalInteractivePanelXterm.tsx +0 -439
- package/src/react-ui/blocks/Terminal/panel/TerminalLogsPanel.tsx +0 -550
- package/src/react-ui/blocks/Terminal/panel/TerminalLogsPanel.types.ts +0 -259
- package/src/react-ui/blocks/Terminal/panel/TerminalPanelChrome.styles.ts +0 -75
- package/src/react-ui/blocks/Terminal/panel/TerminalPanelChrome.tsx +0 -266
- package/src/react-ui/blocks/Terminal/panel/TerminalPanelChrome.types.ts +0 -82
- package/src/react-ui/blocks/Terminal/panel/TerminalPanelFooter.tsx +0 -112
- package/src/react-ui/blocks/Terminal/panel/TerminalPanelHeader.tsx +0 -178
- package/src/react-ui/blocks/Terminal/panel/TerminalPanelToolbar.tsx +0 -203
- package/src/react-ui/blocks/Terminal/panel/TerminalSessionControl.tsx +0 -252
- package/src/react-ui/blocks/Terminal/panel/TerminalSessionTabs.tsx +0 -334
- package/src/react-ui/blocks/Terminal/panel/TerminalSettingsPopover.tsx +0 -261
- package/src/react-ui/blocks/Terminal/panel/TerminalThemeSelector.tsx +0 -248
- package/src/react-ui/blocks/Terminal/panel/index.ts +0 -72
- package/src/react-ui/blocks/Terminal/panel/terminal-filter-dropdown.module.css +0 -59
- package/src/react-ui/blocks/Terminal/panel/terminal-session-tabs.module.css +0 -59
- package/src/react-ui/blocks/Terminal/parsing/BadgeFormatter.ts +0 -180
- package/src/react-ui/blocks/Terminal/parsing/HttpLogParser.ts +0 -248
- package/src/react-ui/blocks/Terminal/parsing/LogParser.types.ts +0 -283
- package/src/react-ui/blocks/Terminal/parsing/LogParserService.ts +0 -686
- package/src/react-ui/blocks/Terminal/parsing/MultilineAggregator.ts +0 -466
- package/src/react-ui/blocks/Terminal/parsing/PersistentLogBuffer.ts +0 -343
- package/src/react-ui/blocks/Terminal/parsing/SyntaxHighlighter.ts +0 -167
- package/src/react-ui/blocks/Terminal/parsing/TableParser.ts +0 -348
- package/src/react-ui/blocks/Terminal/parsing/ansi/AnsiColorMapper.ts +0 -251
- package/src/react-ui/blocks/Terminal/parsing/ansi/AnsiParser.ts +0 -390
- package/src/react-ui/blocks/Terminal/parsing/ansi/ansi.constants.ts +0 -320
- package/src/react-ui/blocks/Terminal/parsing/ansi/index.ts +0 -20
- package/src/react-ui/blocks/Terminal/parsing/index.ts +0 -69
- package/src/react-ui/blocks/Terminal/parsing/levels/LogLevel.types.ts +0 -68
- package/src/react-ui/blocks/Terminal/parsing/levels/LogLevelDetector.ts +0 -436
- package/src/react-ui/blocks/Terminal/parsing/levels/index.ts +0 -14
- package/src/react-ui/blocks/index.ts +0 -11
- package/src/react-ui/components/MorphingPopover/MorphingPopover.types.ts +0 -49
- package/src/react-ui/components/MorphingPopover/index.tsx +0 -186
- package/src/react-ui/components/MorphingPopover/morphing-popover.module.css +0 -153
- package/src/react-ui/components/index.ts +0 -9
- package/src/react-ui/hooks/Animation/UseAutoHeight.tsx +0 -123
- package/src/react-ui/hooks/DOM/UseIsInView.tsx +0 -44
- package/src/react-ui/hooks/Formatting/UseListFormat.ts +0 -134
- package/src/react-ui/hooks/State/UseControlledState.tsx +0 -57
- package/src/react-ui/hooks/State/UseDataState.tsx +0 -76
- package/src/react-ui/hooks/index.ts +0 -20
- package/src/react-ui/icons/index.ts +0 -12
- package/src/react-ui/icons/lucide-animated/activity.tsx +0 -109
- package/src/react-ui/icons/lucide-animated/arrow-down-to-line.tsx +0 -51
- package/src/react-ui/icons/lucide-animated/arrow-up.tsx +0 -50
- package/src/react-ui/icons/lucide-animated/bell-electric.tsx +0 -124
- package/src/react-ui/icons/lucide-animated/bell.tsx +0 -93
- package/src/react-ui/icons/lucide-animated/bot.tsx +0 -122
- package/src/react-ui/icons/lucide-animated/box.tsx +0 -117
- package/src/react-ui/icons/lucide-animated/check.tsx +0 -21
- package/src/react-ui/icons/lucide-animated/circle-check.tsx +0 -107
- package/src/react-ui/icons/lucide-animated/delete.tsx +0 -133
- package/src/react-ui/icons/lucide-animated/download.tsx +0 -99
- package/src/react-ui/icons/lucide-animated/edit-2.tsx +0 -21
- package/src/react-ui/icons/lucide-animated/globe.tsx +0 -23
- package/src/react-ui/icons/lucide-animated/home.tsx +0 -103
- package/src/react-ui/icons/lucide-animated/index.ts +0 -38
- package/src/react-ui/icons/lucide-animated/layers.tsx +0 -23
- package/src/react-ui/icons/lucide-animated/layout-panel-top.tsx +0 -143
- package/src/react-ui/icons/lucide-animated/list.tsx +0 -54
- package/src/react-ui/icons/lucide-animated/package.tsx +0 -24
- package/src/react-ui/icons/lucide-animated/palette.tsx +0 -25
- package/src/react-ui/icons/lucide-animated/plus.tsx +0 -92
- package/src/react-ui/icons/lucide-animated/refresh-cw.tsx +0 -24
- package/src/react-ui/icons/lucide-animated/rocket.tsx +0 -24
- package/src/react-ui/icons/lucide-animated/save.tsx +0 -23
- package/src/react-ui/icons/lucide-animated/search.tsx +0 -94
- package/src/react-ui/icons/lucide-animated/settings.tsx +0 -92
- package/src/react-ui/icons/lucide-animated/terminal.tsx +0 -46
- package/src/react-ui/icons/lucide-animated/trash-2.tsx +0 -25
- package/src/react-ui/icons/lucide-animated/trending-down.tsx +0 -151
- package/src/react-ui/icons/lucide-animated/trending-up.tsx +0 -150
- package/src/react-ui/icons/lucide-animated/type.tsx +0 -23
- package/src/react-ui/icons/lucide-animated/upload.tsx +0 -23
- package/src/react-ui/icons/lucide-animated/x.tsx +0 -102
- package/src/react-ui/index.ts +0 -30
- package/src/react-ui/lib/get-strict-context.tsx +0 -56
- package/src/react-ui/lib/icon-wrapper.tsx +0 -70
- package/src/react-ui/lib/index.ts +0 -9
- package/src/react-ui/lib/utils.ts +0 -24
- package/src/react-ui/primitives/AutoHeight/index.tsx +0 -74
- package/src/react-ui/primitives/CountingNumber/index.tsx +0 -147
- package/src/react-ui/primitives/Highlight/Highlight.types.ts +0 -136
- package/src/react-ui/primitives/Highlight/index.tsx +0 -577
- package/src/react-ui/primitives/Slot/index.tsx +0 -128
- package/src/react-ui/primitives/index.ts +0 -16
- package/src/react-ui/primitives/waapi/Gooey/Gooey.types.ts +0 -123
- package/src/react-ui/primitives/waapi/Gooey/GooeyCanvas.tsx +0 -80
- package/src/react-ui/primitives/waapi/Gooey/GooeyFilter.tsx +0 -77
- package/src/react-ui/primitives/waapi/Gooey/MorphPath.tsx +0 -58
- package/src/react-ui/primitives/waapi/Gooey/gooey-utils.ts +0 -244
- package/src/react-ui/primitives/waapi/Gooey/index.ts +0 -50
- package/src/react-ui/primitives/waapi/Gooey/useMorphPath.ts +0 -48
- package/src/react-ui/primitives/waapi/Morph/Morph.types.ts +0 -106
- package/src/react-ui/primitives/waapi/Morph/MorphContext.tsx +0 -21
- package/src/react-ui/primitives/waapi/Morph/index.tsx +0 -56
- package/src/react-ui/primitives/waapi/Morph/techniques/index.ts +0 -12
- package/src/react-ui/primitives/waapi/Morph/techniques/useCSSGridMorph.ts +0 -89
- package/src/react-ui/primitives/waapi/Morph/techniques/useFLIPClipPath.ts +0 -176
- package/src/react-ui/primitives/waapi/Morph/techniques/useViewTransitions.ts +0 -87
- package/src/react-ui/primitives/waapi/Morph/useMorph.ts +0 -101
- package/src/react-ui/primitives/waapi/Reorder/Reorder.types.ts +0 -177
- package/src/react-ui/primitives/waapi/Reorder/index.tsx +0 -260
- package/src/react-ui/primitives/waapi/Reorder/useReorder.ts +0 -47
- package/src/react-ui/primitives/waapi/Reorder/useReorderPresence.ts +0 -209
- package/src/react-ui/primitives/waapi/Reorder/utils/separatorCoordination.ts +0 -104
- package/src/react-ui/primitives/waapi/SlidingNumber/SlidingNumber.styles.ts +0 -14
- package/src/react-ui/primitives/waapi/SlidingNumber/SlidingNumber.types.ts +0 -84
- package/src/react-ui/primitives/waapi/SlidingNumber/index.tsx +0 -474
- package/src/react-ui/primitives/waapi/SlidingText/SlidingText.styles.ts +0 -32
- package/src/react-ui/primitives/waapi/SlidingText/SlidingText.types.ts +0 -69
- package/src/react-ui/primitives/waapi/SlidingText/index.tsx +0 -140
- package/src/react-ui/primitives/waapi/core/animationConstants.ts +0 -215
- package/src/react-ui/primitives/waapi/core/index.ts +0 -53
- package/src/react-ui/primitives/waapi/core/types.ts +0 -200
- package/src/react-ui/primitives/waapi/core/useAnimationOrchestrator.ts +0 -430
- package/src/react-ui/primitives/waapi/core/useElementRegistry.ts +0 -81
- package/src/react-ui/primitives/waapi/core/useFLIPAnimation.ts +0 -138
- package/src/react-ui/primitives/waapi/core/usePositionCapture.ts +0 -106
- package/src/react-ui/primitives/waapi/index.ts +0 -139
- package/src/react-ui/styles/animations.css +0 -369
- package/src/react-ui/ui/Accordion/Accordion.styles.ts +0 -72
- package/src/react-ui/ui/Accordion/Accordion.types.ts +0 -199
- package/src/react-ui/ui/Accordion/index.tsx +0 -362
- package/src/react-ui/ui/AlertDialog/AlertDialog.styles.ts +0 -38
- package/src/react-ui/ui/AlertDialog/AlertDialog.types.ts +0 -296
- package/src/react-ui/ui/AlertDialog/index.tsx +0 -540
- package/src/react-ui/ui/Badge/Badge.styles.ts +0 -43
- package/src/react-ui/ui/Badge/Badge.types.ts +0 -26
- package/src/react-ui/ui/Badge/index.tsx +0 -34
- package/src/react-ui/ui/Button/Button.styles.ts +0 -57
- package/src/react-ui/ui/Button/Button.types.ts +0 -63
- package/src/react-ui/ui/Button/index.tsx +0 -155
- package/src/react-ui/ui/Card/Card.styles.ts +0 -32
- package/src/react-ui/ui/Card/Card.types.ts +0 -39
- package/src/react-ui/ui/Card/index.tsx +0 -130
- package/src/react-ui/ui/Checkbox/Checkbox.styles.ts +0 -40
- package/src/react-ui/ui/Checkbox/Checkbox.types.ts +0 -98
- package/src/react-ui/ui/Checkbox/index.tsx +0 -233
- package/src/react-ui/ui/Combobox/Combobox.styles.ts +0 -34
- package/src/react-ui/ui/Combobox/Combobox.types.ts +0 -89
- package/src/react-ui/ui/Combobox/index.tsx +0 -331
- package/src/react-ui/ui/CornerBracket/CornerBracket.styles.ts +0 -38
- package/src/react-ui/ui/CornerBracket/CornerBracket.types.ts +0 -15
- package/src/react-ui/ui/CornerBracket/index.tsx +0 -49
- package/src/react-ui/ui/DataCard/DataCard.styles.ts +0 -94
- package/src/react-ui/ui/DataCard/DataCard.types.ts +0 -125
- package/src/react-ui/ui/DataCard/index.tsx +0 -340
- package/src/react-ui/ui/Dialog/Dialog.styles.ts +0 -59
- package/src/react-ui/ui/Dialog/Dialog.types.ts +0 -284
- package/src/react-ui/ui/Dialog/index.tsx +0 -452
- package/src/react-ui/ui/DropdownMenu/DropdownMenu.styles.ts +0 -35
- package/src/react-ui/ui/DropdownMenu/DropdownMenu.types.ts +0 -81
- package/src/react-ui/ui/DropdownMenu/index.tsx +0 -300
- package/src/react-ui/ui/DynamicToggle/DynamicToggle.css +0 -303
- package/src/react-ui/ui/DynamicToggle/DynamicToggle.styles.ts +0 -85
- package/src/react-ui/ui/DynamicToggle/DynamicToggle.types.ts +0 -174
- package/src/react-ui/ui/DynamicToggle/index.tsx +0 -294
- package/src/react-ui/ui/DynamicToggle/prototype-v7.html +0 -615
- package/src/react-ui/ui/DynamicToggle/prototype.html +0 -419
- package/src/react-ui/ui/Field/Field.styles.ts +0 -47
- package/src/react-ui/ui/Field/Field.types.ts +0 -60
- package/src/react-ui/ui/Field/index.tsx +0 -254
- package/src/react-ui/ui/Input/Input.styles.ts +0 -11
- package/src/react-ui/ui/Input/Input.types.ts +0 -10
- package/src/react-ui/ui/Input/index.tsx +0 -32
- package/src/react-ui/ui/InputGroup/InputGroup.styles.ts +0 -53
- package/src/react-ui/ui/InputGroup/InputGroup.types.ts +0 -44
- package/src/react-ui/ui/InputGroup/index.tsx +0 -149
- package/src/react-ui/ui/Label/Label.styles.ts +0 -10
- package/src/react-ui/ui/Label/Label.types.ts +0 -9
- package/src/react-ui/ui/Label/index.tsx +0 -27
- package/src/react-ui/ui/Menu/Menu.styles.ts +0 -71
- package/src/react-ui/ui/Menu/Menu.types.ts +0 -425
- package/src/react-ui/ui/Menu/index.tsx +0 -900
- package/src/react-ui/ui/Popover/Popover.styles.ts +0 -55
- package/src/react-ui/ui/Popover/Popover.types.ts +0 -261
- package/src/react-ui/ui/Popover/index.tsx +0 -422
- package/src/react-ui/ui/Progress/Progress.styles.ts +0 -36
- package/src/react-ui/ui/Progress/Progress.types.ts +0 -162
- package/src/react-ui/ui/Progress/index.tsx +0 -254
- package/src/react-ui/ui/Select/Select.styles.ts +0 -30
- package/src/react-ui/ui/Select/Select.types.ts +0 -51
- package/src/react-ui/ui/Select/index.tsx +0 -225
- package/src/react-ui/ui/Separator/Separator.styles.ts +0 -10
- package/src/react-ui/ui/Separator/Separator.types.ts +0 -10
- package/src/react-ui/ui/Separator/index.tsx +0 -37
- package/src/react-ui/ui/Switch/Switch.styles.ts +0 -50
- package/src/react-ui/ui/Switch/Switch.types.ts +0 -155
- package/src/react-ui/ui/Switch/index.tsx +0 -253
- package/src/react-ui/ui/Tabs/Tabs.css +0 -39
- package/src/react-ui/ui/Tabs/Tabs.styles.ts +0 -148
- package/src/react-ui/ui/Tabs/Tabs.types.ts +0 -255
- package/src/react-ui/ui/Tabs/index.tsx +0 -529
- package/src/react-ui/ui/TextFlow/TextFlow.styles.ts +0 -36
- package/src/react-ui/ui/TextFlow/TextFlow.types.ts +0 -118
- package/src/react-ui/ui/TextFlow/index.tsx +0 -276
- package/src/react-ui/ui/Textarea/Textarea.styles.ts +0 -10
- package/src/react-ui/ui/Textarea/Textarea.types.ts +0 -9
- package/src/react-ui/ui/Textarea/index.tsx +0 -27
- package/src/react-ui/ui/Tooltip/Tooltip.styles.ts +0 -43
- package/src/react-ui/ui/Tooltip/Tooltip.types.ts +0 -253
- package/src/react-ui/ui/Tooltip/index.tsx +0 -394
- package/src/react-ui/ui/index.ts +0 -41
- package/src/types/css-modules.d.ts +0 -18
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Progress component with animated indicator and counting value display.
|
|
5
|
-
*
|
|
6
|
-
* Built on Base UI Progress primitives with Motion animations for
|
|
7
|
-
* spring-based indicator width transitions and CountingNumber for
|
|
8
|
-
* animated numeric value display.
|
|
9
|
-
*
|
|
10
|
-
* @module @mks2508/mks-ui/react/ui/Progress
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```tsx
|
|
14
|
-
* import {
|
|
15
|
-
* Progress,
|
|
16
|
-
* ProgressTrack,
|
|
17
|
-
* ProgressIndicator,
|
|
18
|
-
* ProgressLabel,
|
|
19
|
-
* ProgressValue,
|
|
20
|
-
* } from '@mks2508/mks-ui';
|
|
21
|
-
*
|
|
22
|
-
* function MyProgress() {
|
|
23
|
-
* return (
|
|
24
|
-
* <Progress value={75}>
|
|
25
|
-
* <ProgressLabel>Uploading...</ProgressLabel>
|
|
26
|
-
* <ProgressTrack>
|
|
27
|
-
* <ProgressIndicator />
|
|
28
|
-
* </ProgressTrack>
|
|
29
|
-
* <ProgressValue />
|
|
30
|
-
* </Progress>
|
|
31
|
-
* );
|
|
32
|
-
* }
|
|
33
|
-
* ```
|
|
34
|
-
*/
|
|
35
|
-
|
|
36
|
-
import * as React from 'react';
|
|
37
|
-
import { Progress as ProgressPrimitives } from '@base-ui/react/progress';
|
|
38
|
-
import { motion } from 'motion/react';
|
|
39
|
-
|
|
40
|
-
import { cn } from '@/react-ui/lib/utils';
|
|
41
|
-
import { getStrictContext } from '@/react-ui/lib/get-strict-context';
|
|
42
|
-
import { CountingNumber } from '@/react-ui/primitives/CountingNumber';
|
|
43
|
-
|
|
44
|
-
import { progressStyles } from './Progress.styles';
|
|
45
|
-
import type {
|
|
46
|
-
ProgressContextType,
|
|
47
|
-
IProgressProps,
|
|
48
|
-
IProgressIndicatorProps,
|
|
49
|
-
IProgressTrackProps,
|
|
50
|
-
IProgressLabelProps,
|
|
51
|
-
IProgressValueProps,
|
|
52
|
-
} from './Progress.types';
|
|
53
|
-
|
|
54
|
-
const [ProgressProvider, useProgress] =
|
|
55
|
-
getStrictContext<ProgressContextType>('ProgressContext');
|
|
56
|
-
|
|
57
|
-
const MotionProgressIndicator = motion.create(ProgressPrimitives.Indicator);
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Progress root component that provides progress context to child components.
|
|
61
|
-
*
|
|
62
|
-
* Wraps Base UI `Progress.Root` with a context provider that shares the current
|
|
63
|
-
* progress value with descendant components (indicator, value display, etc.).
|
|
64
|
-
*
|
|
65
|
-
* @param props - Progress props including Base UI root props, slots, and config
|
|
66
|
-
* @returns A progress container element with context provider
|
|
67
|
-
*
|
|
68
|
-
* @example
|
|
69
|
-
* ```tsx
|
|
70
|
-
* <Progress value={50} slots={{ root: 'w-full max-w-md' }}>
|
|
71
|
-
* <ProgressTrack>
|
|
72
|
-
* <ProgressIndicator />
|
|
73
|
-
* </ProgressTrack>
|
|
74
|
-
* </Progress>
|
|
75
|
-
* ```
|
|
76
|
-
*
|
|
77
|
-
* @example
|
|
78
|
-
* ```tsx
|
|
79
|
-
* // With label and animated value
|
|
80
|
-
* <Progress value={loading}>
|
|
81
|
-
* <div className="flex justify-between">
|
|
82
|
-
* <ProgressLabel>Loading assets</ProgressLabel>
|
|
83
|
-
* <ProgressValue />
|
|
84
|
-
* </div>
|
|
85
|
-
* <ProgressTrack>
|
|
86
|
-
* <ProgressIndicator />
|
|
87
|
-
* </ProgressTrack>
|
|
88
|
-
* </Progress>
|
|
89
|
-
* ```
|
|
90
|
-
*/
|
|
91
|
-
function Progress({ className, slots, config: _config, ...props }: IProgressProps) {
|
|
92
|
-
return (
|
|
93
|
-
<ProgressProvider value={{ value: props.value ?? 0 }}>
|
|
94
|
-
<ProgressPrimitives.Root
|
|
95
|
-
data-slot="progress"
|
|
96
|
-
className={cn(progressStyles.root, slots?.root, className)}
|
|
97
|
-
{...props}
|
|
98
|
-
/>
|
|
99
|
-
</ProgressProvider>
|
|
100
|
-
);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* ProgressIndicator renders the animated filled bar within the track.
|
|
105
|
-
*
|
|
106
|
-
* Uses `motion.create` to wrap the Base UI Indicator with spring-based
|
|
107
|
-
* width animation that transitions smoothly as the value changes.
|
|
108
|
-
*
|
|
109
|
-
* @param props - Indicator props including transition config and slot overrides
|
|
110
|
-
* @returns A motion-enhanced indicator element
|
|
111
|
-
*
|
|
112
|
-
* @example
|
|
113
|
-
* ```tsx
|
|
114
|
-
* <ProgressTrack>
|
|
115
|
-
* <ProgressIndicator
|
|
116
|
-
* transition={{ type: 'spring', stiffness: 120, damping: 20 }}
|
|
117
|
-
* slots={{ indicator: 'bg-cyan-500' }}
|
|
118
|
-
* />
|
|
119
|
-
* </ProgressTrack>
|
|
120
|
-
* ```
|
|
121
|
-
*/
|
|
122
|
-
function ProgressIndicator({
|
|
123
|
-
transition = { type: 'spring', stiffness: 100, damping: 30 },
|
|
124
|
-
className,
|
|
125
|
-
slots,
|
|
126
|
-
...props
|
|
127
|
-
}: IProgressIndicatorProps) {
|
|
128
|
-
const { value } = useProgress();
|
|
129
|
-
|
|
130
|
-
return (
|
|
131
|
-
<MotionProgressIndicator
|
|
132
|
-
data-slot="progress-indicator"
|
|
133
|
-
animate={{ width: `${value}%` }}
|
|
134
|
-
transition={transition}
|
|
135
|
-
className={cn(progressStyles.indicator, slots?.indicator, className)}
|
|
136
|
-
{...(props as React.ComponentProps<typeof MotionProgressIndicator>)}
|
|
137
|
-
/>
|
|
138
|
-
);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* ProgressTrack renders the background track bar that contains the indicator.
|
|
143
|
-
*
|
|
144
|
-
* @param props - Track props including Base UI Track props and slot overrides
|
|
145
|
-
* @returns A track element for the progress bar
|
|
146
|
-
*
|
|
147
|
-
* @example
|
|
148
|
-
* ```tsx
|
|
149
|
-
* <ProgressTrack slots={{ track: 'h-3 rounded-lg bg-zinc-800' }}>
|
|
150
|
-
* <ProgressIndicator />
|
|
151
|
-
* </ProgressTrack>
|
|
152
|
-
* ```
|
|
153
|
-
*/
|
|
154
|
-
function ProgressTrack({ className, slots, ...props }: IProgressTrackProps) {
|
|
155
|
-
return (
|
|
156
|
-
<ProgressPrimitives.Track
|
|
157
|
-
data-slot="progress-track"
|
|
158
|
-
className={cn(progressStyles.track, slots?.track, className)}
|
|
159
|
-
{...props}
|
|
160
|
-
/>
|
|
161
|
-
);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* ProgressLabel renders accessible label text for the progress bar.
|
|
166
|
-
*
|
|
167
|
-
* @param props - Label props including Base UI Label props and slot overrides
|
|
168
|
-
* @returns A label element for the progress bar
|
|
169
|
-
*
|
|
170
|
-
* @example
|
|
171
|
-
* ```tsx
|
|
172
|
-
* <ProgressLabel slots={{ label: 'text-xs uppercase tracking-wide' }}>
|
|
173
|
-
* Downloading...
|
|
174
|
-
* </ProgressLabel>
|
|
175
|
-
* ```
|
|
176
|
-
*/
|
|
177
|
-
function ProgressLabel({ className, slots, ...props }: IProgressLabelProps) {
|
|
178
|
-
return (
|
|
179
|
-
<ProgressPrimitives.Label
|
|
180
|
-
data-slot="progress-label"
|
|
181
|
-
className={cn(progressStyles.label, slots?.label, className)}
|
|
182
|
-
{...props}
|
|
183
|
-
/>
|
|
184
|
-
);
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* ProgressValue renders the current progress as an animated counting number.
|
|
189
|
-
*
|
|
190
|
-
* Uses the CountingNumber primitive for spring-based numeric transitions,
|
|
191
|
-
* so the displayed value smoothly animates as progress changes.
|
|
192
|
-
*
|
|
193
|
-
* @param props - Value props combining Base UI Value with CountingNumber props and slot overrides
|
|
194
|
-
* @returns An animated numeric value element
|
|
195
|
-
*
|
|
196
|
-
* @example
|
|
197
|
-
* ```tsx
|
|
198
|
-
* <ProgressValue
|
|
199
|
-
* transition={{ stiffness: 80, damping: 20 }}
|
|
200
|
-
* slots={{ value: 'font-mono text-cyan-400' }}
|
|
201
|
-
* />
|
|
202
|
-
* ```
|
|
203
|
-
*
|
|
204
|
-
* @example
|
|
205
|
-
* ```tsx
|
|
206
|
-
* // With decimal places
|
|
207
|
-
* <ProgressValue decimalPlaces={1} decimalSeparator="." />
|
|
208
|
-
* ```
|
|
209
|
-
*/
|
|
210
|
-
function ProgressValue({
|
|
211
|
-
transition = { stiffness: 80, damping: 20 },
|
|
212
|
-
className,
|
|
213
|
-
slots,
|
|
214
|
-
...props
|
|
215
|
-
}: IProgressValueProps) {
|
|
216
|
-
const { value } = useProgress();
|
|
217
|
-
|
|
218
|
-
return (
|
|
219
|
-
<ProgressPrimitives.Value
|
|
220
|
-
data-slot="progress-value"
|
|
221
|
-
render={
|
|
222
|
-
<CountingNumber
|
|
223
|
-
number={value ?? 0}
|
|
224
|
-
transition={transition}
|
|
225
|
-
className={cn(progressStyles.value, slots?.value, className)}
|
|
226
|
-
{...props}
|
|
227
|
-
/>
|
|
228
|
-
}
|
|
229
|
-
/>
|
|
230
|
-
);
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
export {
|
|
234
|
-
Progress,
|
|
235
|
-
ProgressIndicator,
|
|
236
|
-
ProgressTrack,
|
|
237
|
-
ProgressLabel,
|
|
238
|
-
ProgressValue,
|
|
239
|
-
useProgress,
|
|
240
|
-
};
|
|
241
|
-
|
|
242
|
-
// Re-exports
|
|
243
|
-
export type {
|
|
244
|
-
IProgressProps,
|
|
245
|
-
IProgressIndicatorProps,
|
|
246
|
-
IProgressTrackProps,
|
|
247
|
-
IProgressLabelProps,
|
|
248
|
-
IProgressValueProps,
|
|
249
|
-
IProgressConfig,
|
|
250
|
-
ProgressContextType,
|
|
251
|
-
ProgressSlot,
|
|
252
|
-
} from './Progress.types';
|
|
253
|
-
|
|
254
|
-
export { progressStyles } from './Progress.styles';
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { StyleSlots } from '@/core/types';
|
|
2
|
-
|
|
3
|
-
/** Visual regions for the Select component family. */
|
|
4
|
-
type SelectSlot =
|
|
5
|
-
| 'root'
|
|
6
|
-
| 'trigger'
|
|
7
|
-
| 'content'
|
|
8
|
-
| 'item'
|
|
9
|
-
| 'label'
|
|
10
|
-
| 'separator'
|
|
11
|
-
| 'group'
|
|
12
|
-
| 'value'
|
|
13
|
-
| 'scrollButton';
|
|
14
|
-
|
|
15
|
-
const selectStyles: StyleSlots<SelectSlot> = {
|
|
16
|
-
root: '',
|
|
17
|
-
trigger:
|
|
18
|
-
'border-input data-placeholder:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 gap-1.5 rounded-lg border bg-transparent py-2 pr-2 pl-2.5 text-sm transition-colors select-none focus-visible:ring-3 aria-invalid:ring-3 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*=\'size-\'])]:size-4 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0',
|
|
19
|
-
content:
|
|
20
|
-
'bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 min-w-36 rounded-lg shadow-md ring-1 duration-100 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 relative isolate z-50 max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto data-[align-trigger=true]:animate-none',
|
|
21
|
-
item: 'focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm [&_svg:not([class*=\'size-\'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 relative flex w-full cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0',
|
|
22
|
-
label: 'text-muted-foreground px-1.5 py-1 text-xs',
|
|
23
|
-
separator: 'bg-border -mx-1 my-1 h-px pointer-events-none',
|
|
24
|
-
group: 'scroll-my-1 p-1',
|
|
25
|
-
value: 'flex flex-1 text-left',
|
|
26
|
-
scrollButton: 'bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*=\'size-\'])]:size-4 w-full',
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export { selectStyles };
|
|
30
|
-
export type { SelectSlot };
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import type { Select as SelectPrimitive } from '@base-ui/react/select';
|
|
2
|
-
import type { SlotOverrides } from '@/core/types';
|
|
3
|
-
import type { SelectSlot } from './Select.styles';
|
|
4
|
-
|
|
5
|
-
/** Props for the Select root. */
|
|
6
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7
|
-
type ISelectProps = SelectPrimitive.Root.Props<any>;
|
|
8
|
-
|
|
9
|
-
/** Props for SelectGroup. */
|
|
10
|
-
type ISelectGroupProps = SelectPrimitive.Group.Props;
|
|
11
|
-
|
|
12
|
-
/** Props for SelectValue. */
|
|
13
|
-
type ISelectValueProps = SelectPrimitive.Value.Props;
|
|
14
|
-
|
|
15
|
-
/** Props for SelectTrigger. */
|
|
16
|
-
interface ISelectTriggerProps extends SelectPrimitive.Trigger.Props {
|
|
17
|
-
/** Trigger size variant. */
|
|
18
|
-
size?: 'sm' | 'default';
|
|
19
|
-
/** Override classes for select visual regions. */
|
|
20
|
-
slots?: SlotOverrides<SelectSlot>;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/** Props for SelectContent. */
|
|
24
|
-
interface ISelectContentProps
|
|
25
|
-
extends SelectPrimitive.Popup.Props,
|
|
26
|
-
Pick<
|
|
27
|
-
SelectPrimitive.Positioner.Props,
|
|
28
|
-
'align' | 'alignOffset' | 'side' | 'sideOffset' | 'alignItemWithTrigger'
|
|
29
|
-
> {
|
|
30
|
-
slots?: SlotOverrides<SelectSlot>;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/** Props for SelectLabel. */
|
|
34
|
-
type ISelectLabelProps = SelectPrimitive.GroupLabel.Props;
|
|
35
|
-
|
|
36
|
-
/** Props for SelectItem. */
|
|
37
|
-
type ISelectItemProps = SelectPrimitive.Item.Props;
|
|
38
|
-
|
|
39
|
-
/** Props for SelectSeparator. */
|
|
40
|
-
type ISelectSeparatorProps = SelectPrimitive.Separator.Props;
|
|
41
|
-
|
|
42
|
-
export type {
|
|
43
|
-
ISelectProps,
|
|
44
|
-
ISelectGroupProps,
|
|
45
|
-
ISelectValueProps,
|
|
46
|
-
ISelectTriggerProps,
|
|
47
|
-
ISelectContentProps,
|
|
48
|
-
ISelectLabelProps,
|
|
49
|
-
ISelectItemProps,
|
|
50
|
-
ISelectSeparatorProps,
|
|
51
|
-
};
|
|
@@ -1,225 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Select as SelectPrimitive } from '@base-ui/react/select';
|
|
3
|
-
|
|
4
|
-
import { cn } from '@/react-ui/lib/utils';
|
|
5
|
-
import { HugeiconsIcon } from '@hugeicons/react';
|
|
6
|
-
import {
|
|
7
|
-
UnfoldMoreIcon,
|
|
8
|
-
Tick02Icon,
|
|
9
|
-
ArrowUp01Icon,
|
|
10
|
-
ArrowDown01Icon,
|
|
11
|
-
} from '@hugeicons/core-free-icons';
|
|
12
|
-
import { selectStyles } from './Select.styles';
|
|
13
|
-
import type {
|
|
14
|
-
ISelectGroupProps,
|
|
15
|
-
ISelectValueProps,
|
|
16
|
-
ISelectTriggerProps,
|
|
17
|
-
ISelectContentProps,
|
|
18
|
-
ISelectLabelProps,
|
|
19
|
-
ISelectItemProps,
|
|
20
|
-
ISelectSeparatorProps,
|
|
21
|
-
} from './Select.types';
|
|
22
|
-
|
|
23
|
-
/** Select — root component wrapping Base UI Select. */
|
|
24
|
-
const Select = SelectPrimitive.Root;
|
|
25
|
-
|
|
26
|
-
/** SelectGroup — groups related select items. */
|
|
27
|
-
function SelectGroup({ className, ...props }: ISelectGroupProps) {
|
|
28
|
-
return (
|
|
29
|
-
<SelectPrimitive.Group
|
|
30
|
-
data-slot="select-group"
|
|
31
|
-
className={cn(selectStyles.group, className)}
|
|
32
|
-
{...props}
|
|
33
|
-
/>
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/** SelectValue — displays the selected value text. */
|
|
38
|
-
function SelectValue({ className, ...props }: ISelectValueProps) {
|
|
39
|
-
return (
|
|
40
|
-
<SelectPrimitive.Value
|
|
41
|
-
data-slot="select-value"
|
|
42
|
-
className={cn(selectStyles.value, className)}
|
|
43
|
-
{...props}
|
|
44
|
-
/>
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* SelectTrigger — button that opens the select dropdown.
|
|
50
|
-
*
|
|
51
|
-
* @param size - Trigger size: 'default' or 'sm'
|
|
52
|
-
*
|
|
53
|
-
* @example
|
|
54
|
-
* ```tsx
|
|
55
|
-
* <SelectTrigger>
|
|
56
|
-
* <SelectValue placeholder="Choose..." />
|
|
57
|
-
* </SelectTrigger>
|
|
58
|
-
* ```
|
|
59
|
-
*/
|
|
60
|
-
function SelectTrigger({
|
|
61
|
-
className,
|
|
62
|
-
size = 'default',
|
|
63
|
-
children,
|
|
64
|
-
slots,
|
|
65
|
-
...props
|
|
66
|
-
}: ISelectTriggerProps) {
|
|
67
|
-
return (
|
|
68
|
-
<SelectPrimitive.Trigger
|
|
69
|
-
data-slot="select-trigger"
|
|
70
|
-
data-size={size}
|
|
71
|
-
className={cn(selectStyles.trigger, slots?.trigger, className)}
|
|
72
|
-
{...props}
|
|
73
|
-
>
|
|
74
|
-
{children}
|
|
75
|
-
<SelectPrimitive.Icon
|
|
76
|
-
render={
|
|
77
|
-
<HugeiconsIcon
|
|
78
|
-
icon={UnfoldMoreIcon}
|
|
79
|
-
strokeWidth={2}
|
|
80
|
-
className="text-muted-foreground size-4 pointer-events-none"
|
|
81
|
-
/>
|
|
82
|
-
}
|
|
83
|
-
/>
|
|
84
|
-
</SelectPrimitive.Trigger>
|
|
85
|
-
);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/** SelectContent — dropdown popup content for the select. */
|
|
89
|
-
function SelectContent({
|
|
90
|
-
className,
|
|
91
|
-
children,
|
|
92
|
-
side = 'bottom',
|
|
93
|
-
sideOffset = 4,
|
|
94
|
-
align = 'center',
|
|
95
|
-
alignOffset = 0,
|
|
96
|
-
alignItemWithTrigger = true,
|
|
97
|
-
slots,
|
|
98
|
-
...props
|
|
99
|
-
}: ISelectContentProps) {
|
|
100
|
-
return (
|
|
101
|
-
<SelectPrimitive.Portal>
|
|
102
|
-
<SelectPrimitive.Positioner
|
|
103
|
-
side={side}
|
|
104
|
-
sideOffset={sideOffset}
|
|
105
|
-
align={align}
|
|
106
|
-
alignOffset={alignOffset}
|
|
107
|
-
alignItemWithTrigger={alignItemWithTrigger}
|
|
108
|
-
className="isolate z-50"
|
|
109
|
-
>
|
|
110
|
-
<SelectPrimitive.Popup
|
|
111
|
-
data-slot="select-content"
|
|
112
|
-
data-align-trigger={alignItemWithTrigger}
|
|
113
|
-
className={cn(selectStyles.content, slots?.content, className)}
|
|
114
|
-
{...props}
|
|
115
|
-
>
|
|
116
|
-
<SelectScrollUpButton />
|
|
117
|
-
<SelectPrimitive.List>{children}</SelectPrimitive.List>
|
|
118
|
-
<SelectScrollDownButton />
|
|
119
|
-
</SelectPrimitive.Popup>
|
|
120
|
-
</SelectPrimitive.Positioner>
|
|
121
|
-
</SelectPrimitive.Portal>
|
|
122
|
-
);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
/** SelectLabel — label for a group of select items. */
|
|
126
|
-
function SelectLabel({ className, ...props }: ISelectLabelProps) {
|
|
127
|
-
return (
|
|
128
|
-
<SelectPrimitive.GroupLabel
|
|
129
|
-
data-slot="select-label"
|
|
130
|
-
className={cn(selectStyles.label, className)}
|
|
131
|
-
{...props}
|
|
132
|
-
/>
|
|
133
|
-
);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
/** SelectItem — a single selectable option. */
|
|
137
|
-
function SelectItem({ className, children, ...props }: ISelectItemProps) {
|
|
138
|
-
return (
|
|
139
|
-
<SelectPrimitive.Item
|
|
140
|
-
data-slot="select-item"
|
|
141
|
-
className={cn(selectStyles.item, className)}
|
|
142
|
-
{...props}
|
|
143
|
-
>
|
|
144
|
-
<SelectPrimitive.ItemText className="flex flex-1 gap-2 shrink-0 whitespace-nowrap">
|
|
145
|
-
{children}
|
|
146
|
-
</SelectPrimitive.ItemText>
|
|
147
|
-
<SelectPrimitive.ItemIndicator
|
|
148
|
-
render={
|
|
149
|
-
<span className="pointer-events-none absolute right-2 flex size-4 items-center justify-center" />
|
|
150
|
-
}
|
|
151
|
-
>
|
|
152
|
-
<HugeiconsIcon icon={Tick02Icon} strokeWidth={2} className="pointer-events-none" />
|
|
153
|
-
</SelectPrimitive.ItemIndicator>
|
|
154
|
-
</SelectPrimitive.Item>
|
|
155
|
-
);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
/** SelectSeparator — visual divider between select items. */
|
|
159
|
-
function SelectSeparator({ className, ...props }: ISelectSeparatorProps) {
|
|
160
|
-
return (
|
|
161
|
-
<SelectPrimitive.Separator
|
|
162
|
-
data-slot="select-separator"
|
|
163
|
-
className={cn(selectStyles.separator, className)}
|
|
164
|
-
{...props}
|
|
165
|
-
/>
|
|
166
|
-
);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
/** SelectScrollUpButton — scroll indicator for the top of the list. */
|
|
170
|
-
function SelectScrollUpButton({
|
|
171
|
-
className,
|
|
172
|
-
...props
|
|
173
|
-
}: React.ComponentProps<typeof SelectPrimitive.ScrollUpArrow>) {
|
|
174
|
-
return (
|
|
175
|
-
<SelectPrimitive.ScrollUpArrow
|
|
176
|
-
data-slot="select-scroll-up-button"
|
|
177
|
-
className={cn(selectStyles.scrollButton, 'top-0', className)}
|
|
178
|
-
{...props}
|
|
179
|
-
>
|
|
180
|
-
<HugeiconsIcon icon={ArrowUp01Icon} strokeWidth={2} />
|
|
181
|
-
</SelectPrimitive.ScrollUpArrow>
|
|
182
|
-
);
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
/** SelectScrollDownButton — scroll indicator for the bottom of the list. */
|
|
186
|
-
function SelectScrollDownButton({
|
|
187
|
-
className,
|
|
188
|
-
...props
|
|
189
|
-
}: React.ComponentProps<typeof SelectPrimitive.ScrollDownArrow>) {
|
|
190
|
-
return (
|
|
191
|
-
<SelectPrimitive.ScrollDownArrow
|
|
192
|
-
data-slot="select-scroll-down-button"
|
|
193
|
-
className={cn(selectStyles.scrollButton, 'bottom-0', className)}
|
|
194
|
-
{...props}
|
|
195
|
-
>
|
|
196
|
-
<HugeiconsIcon icon={ArrowDown01Icon} strokeWidth={2} />
|
|
197
|
-
</SelectPrimitive.ScrollDownArrow>
|
|
198
|
-
);
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
export {
|
|
202
|
-
Select,
|
|
203
|
-
SelectContent,
|
|
204
|
-
SelectGroup,
|
|
205
|
-
SelectItem,
|
|
206
|
-
SelectLabel,
|
|
207
|
-
SelectScrollDownButton,
|
|
208
|
-
SelectScrollUpButton,
|
|
209
|
-
SelectSeparator,
|
|
210
|
-
SelectTrigger,
|
|
211
|
-
SelectValue,
|
|
212
|
-
};
|
|
213
|
-
|
|
214
|
-
export type {
|
|
215
|
-
ISelectProps,
|
|
216
|
-
ISelectGroupProps,
|
|
217
|
-
ISelectValueProps,
|
|
218
|
-
ISelectTriggerProps,
|
|
219
|
-
ISelectContentProps,
|
|
220
|
-
ISelectLabelProps,
|
|
221
|
-
ISelectItemProps,
|
|
222
|
-
ISelectSeparatorProps,
|
|
223
|
-
} from './Select.types';
|
|
224
|
-
|
|
225
|
-
export type { SelectSlot } from './Select.styles';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { StyleSlots } from '@/core/types';
|
|
2
|
-
|
|
3
|
-
type SeparatorSlot = 'root';
|
|
4
|
-
|
|
5
|
-
const separatorStyles: StyleSlots<SeparatorSlot> = {
|
|
6
|
-
root: 'bg-border shrink-0 data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch',
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export { separatorStyles };
|
|
10
|
-
export type { SeparatorSlot };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Separator as SeparatorPrimitive } from '@base-ui/react/separator';
|
|
2
|
-
import type { SlotOverrides } from '@/core/types';
|
|
3
|
-
import type { SeparatorSlot } from './Separator.styles';
|
|
4
|
-
|
|
5
|
-
/** Props for the Separator component. */
|
|
6
|
-
interface ISeparatorProps extends SeparatorPrimitive.Props {
|
|
7
|
-
slots?: SlotOverrides<SeparatorSlot>;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export type { ISeparatorProps };
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { Separator as SeparatorPrimitive } from '@base-ui/react/separator';
|
|
4
|
-
|
|
5
|
-
import { cn } from '@/react-ui/lib/utils';
|
|
6
|
-
import { separatorStyles } from './Separator.styles';
|
|
7
|
-
import type { ISeparatorProps } from './Separator.types';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Separator — visual divider wrapping Base UI Separator.
|
|
11
|
-
*
|
|
12
|
-
* @param orientation - 'horizontal' or 'vertical'
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```tsx
|
|
16
|
-
* <Separator orientation="horizontal" />
|
|
17
|
-
* ```
|
|
18
|
-
*/
|
|
19
|
-
function Separator({
|
|
20
|
-
className,
|
|
21
|
-
orientation = 'horizontal',
|
|
22
|
-
slots,
|
|
23
|
-
...props
|
|
24
|
-
}: ISeparatorProps) {
|
|
25
|
-
return (
|
|
26
|
-
<SeparatorPrimitive
|
|
27
|
-
data-slot="separator"
|
|
28
|
-
orientation={orientation}
|
|
29
|
-
className={cn(separatorStyles.root, slots?.root, className)}
|
|
30
|
-
{...props}
|
|
31
|
-
/>
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export { Separator };
|
|
36
|
-
export type { ISeparatorProps } from './Separator.types';
|
|
37
|
-
export type { SeparatorSlot } from './Separator.styles';
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Style slots and CVA variants for the Switch component.
|
|
3
|
-
*
|
|
4
|
-
* @module @mks2508/mks-ui/react/ui/Switch/Switch.styles
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import type { StyleSlots } from '@/core/types';
|
|
8
|
-
|
|
9
|
-
import type { SwitchSlot } from './Switch.types';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Default style slots for the Switch component.
|
|
13
|
-
* Each key maps to a visual region with its base Tailwind classes.
|
|
14
|
-
*
|
|
15
|
-
* - `root` - The outer switch track with rounded shape, background, and focus styles
|
|
16
|
-
* - `thumb` - The sliding thumb indicator with sizing and shape
|
|
17
|
-
* - `icon` - Icons positioned within the switch track or thumb
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* ```typescript
|
|
21
|
-
* import { switchStyles } from './Switch.styles';
|
|
22
|
-
*
|
|
23
|
-
* // Access the root slot classes
|
|
24
|
-
* const rootClasses = switchStyles.root;
|
|
25
|
-
* // 'group inline-flex items-center ...'
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
export const switchStyles: StyleSlots<SwitchSlot> = {
|
|
29
|
-
root: [
|
|
30
|
-
'group inline-flex items-center',
|
|
31
|
-
'h-6 w-11 shrink-0',
|
|
32
|
-
'cursor-pointer rounded-full',
|
|
33
|
-
'border-2 border-transparent',
|
|
34
|
-
'bg-input',
|
|
35
|
-
'transition-colors',
|
|
36
|
-
'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',
|
|
37
|
-
'disabled:cursor-not-allowed disabled:opacity-50',
|
|
38
|
-
'data-[checked]:bg-primary',
|
|
39
|
-
].join(' '),
|
|
40
|
-
thumb: [
|
|
41
|
-
'pointer-events-none block',
|
|
42
|
-
'size-5 rounded-full',
|
|
43
|
-
'bg-background',
|
|
44
|
-
'shadow-lg ring-0',
|
|
45
|
-
].join(' '),
|
|
46
|
-
icon: [
|
|
47
|
-
'pointer-events-none',
|
|
48
|
-
'flex items-center justify-center',
|
|
49
|
-
].join(' '),
|
|
50
|
-
};
|