@companix/uikit 0.0.2 → 0.0.4
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/Button/index.d.ts +20 -0
- package/dist/ButtonGroup/index.d.ts +7 -0
- package/dist/Checkbox/index.d.ts +10 -0
- package/dist/Countdown/index.d.ts +7 -0
- package/dist/DateInput/index.d.ts +13 -0
- package/dist/DatePicker/Calendar.d.ts +14 -0
- package/dist/DatePicker/CalendarHeader.d.ts +10 -0
- package/dist/DatePicker/index.d.ts +12 -0
- package/dist/Dialog/index.d.ts +12 -0
- package/dist/DialogAlert/Alert.d.ts +19 -0
- package/dist/DialogAlert/Viewport.d.ts +8 -0
- package/dist/DialogAlert/index.d.ts +11 -0
- package/dist/Drawer/index.d.ts +13 -0
- package/dist/File/index.d.ts +10 -0
- package/dist/Form/index.d.ts +17 -0
- package/dist/Icon/index.d.ts +7 -0
- package/dist/LoadButton/index.d.ts +5 -0
- package/dist/NumberInput/index.d.ts +6 -0
- package/dist/OptionItem/OptionItem.d.ts +7 -0
- package/dist/OptionItem/OptionsList.d.ts +8 -0
- package/dist/Popover/index.d.ts +26 -0
- package/dist/Radio/index.d.ts +20 -0
- package/dist/Scrollable/ImitateScroll.d.ts +10 -0
- package/dist/Scrollable/index.d.ts +33 -0
- package/dist/Select/SelectInput.d.ts +14 -0
- package/dist/Select/index.d.ts +15 -0
- package/dist/SelectTags/index.d.ts +15 -0
- package/dist/Spinner/index.d.ts +8 -0
- package/dist/Stepper/index.d.ts +8 -0
- package/dist/Switch/index.d.ts +10 -0
- package/dist/Tabs/index.d.ts +13 -0
- package/dist/TextArea/index.d.ts +7 -0
- package/dist/Toaster/RemoveListener.d.ts +3 -0
- package/dist/Toaster/Toast.d.ts +9 -0
- package/dist/Toaster/Viewport.d.ts +13 -0
- package/dist/Toaster/index.d.ts +15 -0
- package/dist/Tooltip/index.d.ts +8 -0
- package/dist/__hooks/use-frooze-closing.d.ts +5 -0
- package/dist/__hooks/use-loading.d.ts +8 -0
- package/dist/__hooks/use-local-storage.d.ts +1 -0
- package/dist/__hooks/use-popover-position.d.ts +8 -0
- package/dist/__hooks/use-previos.d.ts +2 -0
- package/dist/__hooks/use-resize.d.ts +3 -0
- package/dist/__hooks/use-scrollbox.d.ts +7 -0
- package/dist/__hooks/use-stepper-input.d.ts +13 -0
- package/dist/__hooks/use-update.d.ts +1 -0
- package/dist/__hooks/useCalendar.d.ts +17 -0
- package/dist/__hooks/useCalendarOptions-copy.d.ts +22 -0
- package/dist/__hooks/useCalendarOptions.d.ts +31 -0
- package/dist/__libs/calendar.d.ts +25 -0
- package/dist/__utils/utils.d.ts +25 -0
- package/dist/bundle.es.js +58 -0
- package/dist/bundle.es10.js +38 -0
- package/dist/bundle.es11.js +33 -0
- package/dist/bundle.es12.js +18 -0
- package/dist/bundle.es13.js +10 -0
- package/dist/bundle.es14.js +35 -0
- package/dist/bundle.es15.js +27 -0
- package/dist/bundle.es16.js +23 -0
- package/dist/bundle.es17.js +24 -0
- package/dist/bundle.es18.js +15 -0
- package/dist/bundle.es19.js +40 -0
- package/dist/bundle.es2.js +45 -0
- package/dist/bundle.es20.js +18 -0
- package/dist/bundle.es21.js +36 -0
- package/dist/bundle.es22.js +23 -0
- package/dist/bundle.es23.js +42 -0
- package/dist/bundle.es24.js +113 -0
- package/dist/bundle.es25.js +114 -0
- package/dist/bundle.es26.js +38 -0
- package/dist/bundle.es27.js +13 -0
- package/dist/bundle.es28.js +27 -0
- package/dist/bundle.es29.js +38 -0
- package/dist/bundle.es3.js +13 -0
- package/dist/bundle.es30.js +26 -0
- package/dist/bundle.es31.js +83 -0
- package/dist/bundle.es32.js +20 -0
- package/dist/bundle.es33.js +16 -0
- package/dist/bundle.es34.js +24 -0
- package/dist/bundle.es35.js +7 -0
- package/dist/bundle.es36.js +23 -0
- package/dist/bundle.es37.js +16 -0
- package/dist/bundle.es38.js +72 -0
- package/dist/bundle.es39.js +70 -0
- package/dist/bundle.es4.js +87 -0
- package/dist/bundle.es40.js +34 -0
- package/dist/bundle.es41.js +70 -0
- package/dist/bundle.es42.js +33 -0
- package/dist/bundle.es43.js +77 -0
- package/dist/bundle.es44.js +51 -0
- package/dist/bundle.es45.js +45 -0
- package/dist/bundle.es5.js +87 -0
- package/dist/bundle.es6.js +80 -0
- package/dist/bundle.es7.js +28 -0
- package/dist/bundle.es8.js +87 -0
- package/dist/bundle.es9.js +75 -0
- package/dist/index.d.ts +30 -0
- package/{src → dist}/index.scss +3 -0
- package/{src → dist}/mixins.scss +4 -3
- package/{src → dist}/theme.scss +0 -2
- package/dist/types.d.ts +13 -0
- package/package.json +10 -6
- package/.eslintrc +0 -54
- package/declaration.d.ts +0 -4
- package/index.html +0 -12
- package/playground/App.tsx +0 -166
- package/playground/Example.tsx +0 -14
- package/playground/Test.tsx +0 -44
- package/playground/animation-test-1/index.scss +0 -20
- package/playground/animation-test-1/index.tsx +0 -17
- package/playground/animation-test-2/index.scss +0 -62
- package/playground/animation-test-2/index.tsx +0 -32
- package/playground/bootstrap.tsx +0 -19
- package/playground/buttons/index.tsx +0 -132
- package/playground/checkbox/index.tsx +0 -64
- package/playground/date-input/index.tsx +0 -45
- package/playground/date-picker/index.tsx +0 -41
- package/playground/dialog/index.tsx +0 -92
- package/playground/dialog-alert/index.tsx +0 -47
- package/playground/drawer/index.tsx +0 -55
- package/playground/index.css +0 -33
- package/playground/index.scss +0 -270
- package/playground/input/index.tsx +0 -112
- package/playground/number-inputs/index.tsx +0 -50
- package/playground/popovers/index.tsx +0 -70
- package/playground/radio-group/index.tsx +0 -69
- package/playground/select/index.tsx +0 -72
- package/playground/select-tags/index.tsx +0 -36
- package/playground/styles.scss +0 -2
- package/playground/switch/index.tsx +0 -44
- package/playground/tabs/index.tsx +0 -16
- package/playground/test.scss +0 -0
- package/playground/text-area/index.tsx +0 -17
- package/playground/text-input/index.tsx +0 -12
- package/playground/toaster/index.tsx +0 -156
- package/playground/tooltip/index.tsx +0 -26
- package/src/Button/index.tsx +0 -72
- package/src/ButtonGroup/index.tsx +0 -20
- package/src/Checkbox/index.tsx +0 -46
- package/src/Countdown/index.tsx +0 -54
- package/src/DateInput/index.tsx +0 -96
- package/src/DatePicker/Calendar.tsx +0 -157
- package/src/DatePicker/CalendarHeader.tsx +0 -139
- package/src/DatePicker/index.tsx +0 -177
- package/src/Dialog/index.tsx +0 -31
- package/src/DialogAlert/Alert.tsx +0 -78
- package/src/DialogAlert/Viewport.tsx +0 -52
- package/src/DialogAlert/index.tsx +0 -37
- package/src/Drawer/index.tsx +0 -46
- package/src/File/index.tsx +0 -60
- package/src/Form/index.tsx +0 -131
- package/src/Icon/index.tsx +0 -43
- package/src/LoadButton/index.tsx +0 -17
- package/src/NumberInput/index.tsx +0 -74
- package/src/OptionItem/OptionItem.tsx +0 -49
- package/src/OptionItem/OptionsList.tsx +0 -26
- package/src/Popover/index.tsx +0 -117
- package/src/Radio/index.tsx +0 -68
- package/src/Scrollable/ImitateScroll.tsx +0 -141
- package/src/Scrollable/index.tsx +0 -141
- package/src/Select/SelectInput.tsx +0 -131
- package/src/Select/index.tsx +0 -134
- package/src/SelectTags/index.tsx +0 -192
- package/src/Spinner/index.tsx +0 -19
- package/src/Stepper/index.tsx +0 -76
- package/src/Switch/index.tsx +0 -49
- package/src/Tabs/index.tsx +0 -89
- package/src/TextArea/index.tsx +0 -51
- package/src/Toaster/RemoveListener.tsx +0 -11
- package/src/Toaster/Toast.tsx +0 -69
- package/src/Toaster/Viewport.tsx +0 -117
- package/src/Toaster/index.tsx +0 -52
- package/src/Tooltip/index.tsx +0 -33
- package/src/__hooks/use-frooze-closing.ts +0 -51
- package/src/__hooks/use-loading.ts +0 -34
- package/src/__hooks/use-local-storage.ts +0 -19
- package/src/__hooks/use-popover-position.ts +0 -24
- package/src/__hooks/use-previos.ts +0 -25
- package/src/__hooks/use-resize.ts +0 -41
- package/src/__hooks/use-scrollbox.ts +0 -45
- package/src/__hooks/use-stepper-input.ts +0 -82
- package/src/__hooks/use-update.ts +0 -19
- package/src/__hooks/useCalendar.ts +0 -104
- package/src/__hooks/useCalendarOptions-copy.ts +0 -87
- package/src/__hooks/useCalendarOptions.ts +0 -68
- package/src/__libs/calendar.ts +0 -175
- package/src/__utils/utils.ts +0 -137
- package/src/index.ts +0 -36
- package/src/types.ts +0 -14
- package/tailwind.config.js +0 -91
- package/themes/classic/animations.scss +0 -179
- package/themes/classic/classic.scss +0 -493
- package/tsconfig.json +0 -27
- package/vite.build.ts +0 -35
- package/vite.config.ts +0 -33
- /package/{src → dist}/Button/Button.scss +0 -0
- /package/{src → dist}/ButtonGroup/ButtonGroup.scss +0 -0
- /package/{src → dist}/Checkbox/Checkbox.scss +0 -0
- /package/{src → dist}/DateInput/DateInput.scss +0 -0
- /package/{src → dist}/DatePicker/Calendar.scss +0 -0
- /package/{src → dist}/DatePicker/DatePicker.scss +0 -0
- /package/{src → dist}/Dialog/Dialog.scss +0 -0
- /package/{src → dist}/Dialog/Popup.scss +0 -0
- /package/{src → dist}/DialogAlert/Alert.scss +0 -0
- /package/{src → dist}/Drawer/Drawer.scss +0 -0
- /package/{src → dist}/Form/Form.scss +0 -0
- /package/{src → dist}/Form/Input.scss +0 -0
- /package/{src → dist}/Icon/icon.scss +0 -0
- /package/{src → dist}/OptionItem/Option.scss +0 -0
- /package/{src → dist}/Popover/Popover.scss +0 -0
- /package/{src → dist}/Radio/Radio.scss +0 -0
- /package/{src → dist}/Scrollable/Scrollable.scss +0 -0
- /package/{src → dist}/Select/Select.scss +0 -0
- /package/{src → dist}/SelectTags/SelectTags.scss +0 -0
- /package/{src → dist}/Spinner/Spinner.scss +0 -0
- /package/{src → dist}/Stepper/StepperInput.scss +0 -0
- /package/{src → dist}/Switch/Switch.scss +0 -0
- /package/{src → dist}/Tabs/Tabs.scss +0 -0
- /package/{src → dist}/TextArea/TextArea.scss +0 -0
- /package/{src → dist}/Toaster/Toaster.scss +0 -0
- /package/{src → dist}/Tooltip/Tooltip.scss +0 -0
- /package/{src/css.scss → dist/css-properties.scss} +0 -0
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
// Описание test-2-animation: анимация запускается через transform, а исчезает через opacity
|
|
2
|
-
|
|
3
|
-
// Данный пример необходим для понимания прерывания enter анимации
|
|
4
|
-
// Анимация появления (data-enter) намеренно сделана долгой, чтобы запустить завершение анимации ещё до окончания анимации enter.
|
|
5
|
-
// В случае если анимация enter была бы окончена, вызов завершения анимации запускал бы этап [data-leave], однако при вызове завершения
|
|
6
|
-
// в моменте выполнения enter, [data-leave] не будет вызван, а вместо этого будет добавлен атрибут [data-closed], который запустит анимацию вспять, до initial состояния, которое описано в [data-closed][data-enter]
|
|
7
|
-
|
|
8
|
-
.test-2-animation {
|
|
9
|
-
// initial - начальное состояние (перед появлением)
|
|
10
|
-
&[data-closed][data-enter] {
|
|
11
|
-
transform: scale(0.3);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
// animate from initial - анимация до конечного состояния, от начального
|
|
15
|
-
&[data-enter] {
|
|
16
|
-
transform: scale(1);
|
|
17
|
-
transition-delay: 0;
|
|
18
|
-
transition-duration: 2s;
|
|
19
|
-
transition-property: transform;
|
|
20
|
-
transition-timing-function: linear;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// exit - анимация завершения
|
|
24
|
-
&[data-leave] {
|
|
25
|
-
transition-delay: 0;
|
|
26
|
-
transition-duration: 1s;
|
|
27
|
-
transition-property: opacity;
|
|
28
|
-
transition-timing-function: linear;
|
|
29
|
-
opacity: 0;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// В данном примере, анимировано прерывание enter
|
|
34
|
-
|
|
35
|
-
.test-2-completed-animation {
|
|
36
|
-
// начальное состояние
|
|
37
|
-
// также будет запускаться при прерывании enter-анимации
|
|
38
|
-
&[data-closed][data-enter] {
|
|
39
|
-
// описываем начальное состояние (перед появлением). Обращаю внимание что "opacity: 0" не будет учтен при data-enter анимации
|
|
40
|
-
transform: scale(0.3);
|
|
41
|
-
opacity: 0;
|
|
42
|
-
// стили использующиеся при прерывании data-enter анимации (переход в начальное состояние)
|
|
43
|
-
transition-duration: 200ms;
|
|
44
|
-
transition-property: transform, opacity; // учитываем opacity
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// animate - анимация появления запускаемая от начального до конечного состояния
|
|
48
|
-
&[data-enter] {
|
|
49
|
-
transform: scale(1);
|
|
50
|
-
transition-duration: 2s;
|
|
51
|
-
transition-property: transform;
|
|
52
|
-
transition-timing-function: linear;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// exit - анимация завершения
|
|
56
|
-
&[data-leave] {
|
|
57
|
-
transition-duration: 1s;
|
|
58
|
-
transition-property: opacity;
|
|
59
|
-
transition-timing-function: linear;
|
|
60
|
-
opacity: 0;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import './index.scss'
|
|
2
|
-
// import { useState } from 'react'
|
|
3
|
-
|
|
4
|
-
export const Test2Animation = () => {
|
|
5
|
-
// const [open, setOpen] = useState(false)
|
|
6
|
-
|
|
7
|
-
return (
|
|
8
|
-
<div style={{ padding: '40px', display: 'flex', gap: '20px' }}>
|
|
9
|
-
<div style={{ padding: '10px', width: '200px' }}>
|
|
10
|
-
{/* <button onClick={() => setOpen((open) => !open)}>Animation 2(*1)</button> */}
|
|
11
|
-
{/* <Transition show={open}> */}
|
|
12
|
-
<div className="test-2-animation box-styles">Target element</div>
|
|
13
|
-
{/* </Transition> */}
|
|
14
|
-
</div>
|
|
15
|
-
</div>
|
|
16
|
-
)
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export const Test2CompletedAnimation = () => {
|
|
20
|
-
// const [open, setOpen] = useState(false)
|
|
21
|
-
|
|
22
|
-
return (
|
|
23
|
-
<div style={{ padding: '40px', display: 'flex', gap: '20px' }}>
|
|
24
|
-
<div style={{ padding: '10px', width: '200px' }}>
|
|
25
|
-
{/* <button onClick={() => setOpen((open) => !open)}>Animation 2(*2)</button> */}
|
|
26
|
-
{/* <Transition show={open}> */}
|
|
27
|
-
<div className="test-2-completed-animation box-styles">Target element</div>
|
|
28
|
-
{/* </Transition> */}
|
|
29
|
-
</div>
|
|
30
|
-
</div>
|
|
31
|
-
)
|
|
32
|
-
}
|
package/playground/bootstrap.tsx
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import './styles.scss'
|
|
2
|
-
|
|
3
|
-
import './index.scss'
|
|
4
|
-
import './index.css'
|
|
5
|
-
import '../src/theme.scss'
|
|
6
|
-
|
|
7
|
-
import { createRoot } from 'react-dom/client'
|
|
8
|
-
import { App } from './App'
|
|
9
|
-
// import { TestApp } from './Test'
|
|
10
|
-
|
|
11
|
-
createRoot(document.getElementById('root')!).render(<App />)
|
|
12
|
-
|
|
13
|
-
const error = console.error
|
|
14
|
-
console.error = (...args: any) => {
|
|
15
|
-
if (/defaultProps/.test(args[0])) return
|
|
16
|
-
if (/findDOMNode/.test(args[0])) return
|
|
17
|
-
|
|
18
|
-
error(...args)
|
|
19
|
-
}
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
import { Appearance, Button, Mode, Size } from '@/Button'
|
|
2
|
-
import {
|
|
3
|
-
faPlay,
|
|
4
|
-
faPause,
|
|
5
|
-
faBookmark,
|
|
6
|
-
faArrowRight,
|
|
7
|
-
faChevronRight,
|
|
8
|
-
faFolderBlank,
|
|
9
|
-
faEye,
|
|
10
|
-
faCaretDown,
|
|
11
|
-
faPen,
|
|
12
|
-
faFile
|
|
13
|
-
} from '@fortawesome/free-solid-svg-icons'
|
|
14
|
-
import { Icon } from '@/Icon'
|
|
15
|
-
import { ButtonGroup } from '@/ButtonGroup'
|
|
16
|
-
|
|
17
|
-
const appearances: Appearance[] = ['primary', 'neutral', 'positive', 'negative']
|
|
18
|
-
const modes: Mode[] = ['default', 'outline', 'minimal']
|
|
19
|
-
const sizes: Size[] = ['sm', 'md', 'lg']
|
|
20
|
-
|
|
21
|
-
export const ButtonsExample = () => {
|
|
22
|
-
return (
|
|
23
|
-
<div className="col-group">
|
|
24
|
-
{appearances.map((appearance) => {
|
|
25
|
-
return (
|
|
26
|
-
<div className="row-group" key={`appearance-${appearance}`}>
|
|
27
|
-
{modes.map((mode) => (
|
|
28
|
-
<Button key={`mode-1-${appearance}-${mode}`} appearance={appearance} mode={mode}>
|
|
29
|
-
Button
|
|
30
|
-
</Button>
|
|
31
|
-
))}
|
|
32
|
-
{[...modes].reverse().map((mode) => (
|
|
33
|
-
<Button key={`mode-2-${appearance}-${mode}`} appearance={appearance} mode={mode} disabled>
|
|
34
|
-
Button
|
|
35
|
-
</Button>
|
|
36
|
-
))}
|
|
37
|
-
</div>
|
|
38
|
-
)
|
|
39
|
-
})}
|
|
40
|
-
<div className="row-group">
|
|
41
|
-
{sizes.map((size) => (
|
|
42
|
-
<Button key={`size-${size}`} icon={<Icon icon={faBookmark} size="xxxs" />} size={size}>
|
|
43
|
-
Button
|
|
44
|
-
</Button>
|
|
45
|
-
))}
|
|
46
|
-
</div>
|
|
47
|
-
<div className="row-group">
|
|
48
|
-
<Button icon={<Icon icon={faPause} size="xxxs" />} size="md"></Button>
|
|
49
|
-
<Button icon={<Icon icon={faPlay} size="xxxs" />} size="md">
|
|
50
|
-
Button
|
|
51
|
-
</Button>
|
|
52
|
-
<Button iconRight={<Icon icon={faArrowRight} size="xxxs" />}>Button</Button>
|
|
53
|
-
<Button fill iconRight={<Icon icon={faChevronRight} size="xxxs" className="quieter" />}>
|
|
54
|
-
Button
|
|
55
|
-
</Button>
|
|
56
|
-
<Button
|
|
57
|
-
fill
|
|
58
|
-
icon={<Icon icon={faFolderBlank} size="xxxs" />}
|
|
59
|
-
iconRight={<Icon icon={faChevronRight} size="xxxs" className="quieter" />}
|
|
60
|
-
>
|
|
61
|
-
Button
|
|
62
|
-
</Button>
|
|
63
|
-
</div>
|
|
64
|
-
<div className="row-group">
|
|
65
|
-
<Button fill align="left">
|
|
66
|
-
Left
|
|
67
|
-
</Button>
|
|
68
|
-
<Button fill align="center">
|
|
69
|
-
Center
|
|
70
|
-
</Button>
|
|
71
|
-
<Button fill align="right">
|
|
72
|
-
Right
|
|
73
|
-
</Button>
|
|
74
|
-
</div>
|
|
75
|
-
<div className="row-group">
|
|
76
|
-
<Button loading>Button fullwidth</Button>
|
|
77
|
-
<Button disabled>Button disabled</Button>
|
|
78
|
-
<Button fill>Button fullwidth</Button>
|
|
79
|
-
</div>
|
|
80
|
-
</div>
|
|
81
|
-
)
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export const ButtonsGroupExample = () => {
|
|
85
|
-
return (
|
|
86
|
-
<div className="col-group">
|
|
87
|
-
<div className="row-group">
|
|
88
|
-
<ButtonGroup>
|
|
89
|
-
<Button>Button One</Button>
|
|
90
|
-
<Button>Button Two</Button>
|
|
91
|
-
<Button>Button Three</Button>
|
|
92
|
-
</ButtonGroup>
|
|
93
|
-
</div>
|
|
94
|
-
<div className="row-group">
|
|
95
|
-
<ButtonGroup fill>
|
|
96
|
-
<Button>Secondary</Button>
|
|
97
|
-
<Button fill>Primary</Button>
|
|
98
|
-
</ButtonGroup>
|
|
99
|
-
</div>
|
|
100
|
-
<div className="row-group">
|
|
101
|
-
<ButtonGroup>
|
|
102
|
-
<Button icon={<Icon icon={faBookmark} size="xxxs" />} />
|
|
103
|
-
<Button>Button name</Button>
|
|
104
|
-
</ButtonGroup>
|
|
105
|
-
<ButtonGroup>
|
|
106
|
-
<Button>Button name</Button>
|
|
107
|
-
<Button icon={<Icon icon={faBookmark} size="xxxs" />} />
|
|
108
|
-
</ButtonGroup>
|
|
109
|
-
<ButtonGroup>
|
|
110
|
-
<Button
|
|
111
|
-
icon={<Icon icon={faFile} size="xxxs" />}
|
|
112
|
-
iconRight={<Icon icon={faCaretDown} size="xxxs" className="quieter" />}
|
|
113
|
-
>
|
|
114
|
-
File
|
|
115
|
-
</Button>
|
|
116
|
-
<Button
|
|
117
|
-
icon={<Icon icon={faPen} size="xxxs" />}
|
|
118
|
-
iconRight={<Icon icon={faCaretDown} size="xxxs" className="quieter" />}
|
|
119
|
-
>
|
|
120
|
-
Edit
|
|
121
|
-
</Button>
|
|
122
|
-
<Button
|
|
123
|
-
icon={<Icon icon={faEye} size="xxxs" />}
|
|
124
|
-
iconRight={<Icon icon={faCaretDown} size="xxxs" className="quieter" />}
|
|
125
|
-
>
|
|
126
|
-
View
|
|
127
|
-
</Button>
|
|
128
|
-
</ButtonGroup>
|
|
129
|
-
</div>
|
|
130
|
-
</div>
|
|
131
|
-
)
|
|
132
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { Checkbox } from '@/Checkbox'
|
|
2
|
-
import { Icon } from '@/Icon'
|
|
3
|
-
import { Tooltip } from '@/Tooltip'
|
|
4
|
-
import { faInfoCircle } from '@fortawesome/free-solid-svg-icons'
|
|
5
|
-
import { useState } from 'react'
|
|
6
|
-
|
|
7
|
-
const longtext = `The expanded form makes it easy to schedule meetings: fields to fill out are displayed on the left, and the participants' schedule is shown on the right.`
|
|
8
|
-
|
|
9
|
-
export const CheckboxExample = () => {
|
|
10
|
-
return (
|
|
11
|
-
<div className="col-group">
|
|
12
|
-
<div className="flex gap-24">
|
|
13
|
-
<div className="flex flex-col gap-12">
|
|
14
|
-
<CheckboxControl label="Accept terms and conditions" size="md" defaultChecked />
|
|
15
|
-
<CheckboxControl label="I want to recieve promote emails" size="sm" defaultChecked />
|
|
16
|
-
</div>
|
|
17
|
-
<div className="flex flex-col gap-12">
|
|
18
|
-
<CheckboxControl label="Accept terms and conditions" size="md" disabled defaultChecked />
|
|
19
|
-
<CheckboxControl label="I want to recieve promote emails" size="sm" disabled />
|
|
20
|
-
</div>
|
|
21
|
-
</div>
|
|
22
|
-
<div style={{ height: '1px', background: '#eeeeee', margin: '12px 0px' }} />
|
|
23
|
-
<div className="flex flex-col gap-12">
|
|
24
|
-
<CheckboxControl label="Accept terms and conditions" size="md" defaultChecked />
|
|
25
|
-
<CheckboxControl
|
|
26
|
-
size="md"
|
|
27
|
-
defaultChecked
|
|
28
|
-
label={
|
|
29
|
-
<>
|
|
30
|
-
<span>Use the advanced form to create events</span>
|
|
31
|
-
<Tooltip side="top" content={longtext}>
|
|
32
|
-
<span className="help-tip">
|
|
33
|
-
<Icon icon={faInfoCircle} size="xxxs" />
|
|
34
|
-
</span>
|
|
35
|
-
</Tooltip>
|
|
36
|
-
</>
|
|
37
|
-
}
|
|
38
|
-
/>
|
|
39
|
-
<CheckboxControl label={longtext + ' ' + longtext} size="md" defaultChecked />
|
|
40
|
-
</div>
|
|
41
|
-
<div style={{ height: '1px', background: '#eeeeee', margin: '12px 0px' }} />
|
|
42
|
-
<div>
|
|
43
|
-
<div className="flex flex-col gap-12">
|
|
44
|
-
<CheckboxControl label="Accept terms and conditions" size="md" required />
|
|
45
|
-
<CheckboxControl label="I want to recieve promote emails" size="sm" required />
|
|
46
|
-
</div>
|
|
47
|
-
</div>
|
|
48
|
-
</div>
|
|
49
|
-
)
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
interface Props {
|
|
53
|
-
label?: React.ReactNode
|
|
54
|
-
size?: 'md' | 'sm'
|
|
55
|
-
defaultChecked?: boolean
|
|
56
|
-
disabled?: boolean
|
|
57
|
-
required?: boolean
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
const CheckboxControl = ({ defaultChecked, ...props }: Props) => {
|
|
61
|
-
const [checked, setCheck] = useState(defaultChecked ?? false)
|
|
62
|
-
|
|
63
|
-
return <Checkbox {...props} checked={checked} onCheckedChange={setCheck} />
|
|
64
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { DateInput } from '@/DateInput'
|
|
2
|
-
import { useState } from 'react'
|
|
3
|
-
|
|
4
|
-
export const DateInputExample = () => {
|
|
5
|
-
return (
|
|
6
|
-
<div className="flex flex-col gap-14">
|
|
7
|
-
<div className="flex items-center gap-40">
|
|
8
|
-
<div style={{ maxWidth: '340px', width: '340px' }}>
|
|
9
|
-
<DateInputControl size="md" />
|
|
10
|
-
</div>
|
|
11
|
-
<div style={{ maxWidth: '340px', width: '340px' }}>
|
|
12
|
-
<DateInputControl size="md" disabled />
|
|
13
|
-
</div>
|
|
14
|
-
<div style={{ maxWidth: '340px', width: '340px' }}>
|
|
15
|
-
<DateInputControl size="md" required />
|
|
16
|
-
</div>
|
|
17
|
-
</div>
|
|
18
|
-
<div className="flex items-center gap-40">
|
|
19
|
-
<div style={{ maxWidth: '340px', width: '340px' }}>
|
|
20
|
-
<DateInputControl size="sm" />
|
|
21
|
-
</div>
|
|
22
|
-
<div style={{ maxWidth: '340px', width: '340px' }}>
|
|
23
|
-
<DateInputControl size="sm" disabled />
|
|
24
|
-
</div>
|
|
25
|
-
<div style={{ maxWidth: '340px', width: '340px' }}>
|
|
26
|
-
<DateInputControl size="sm" required />
|
|
27
|
-
</div>
|
|
28
|
-
</div>
|
|
29
|
-
</div>
|
|
30
|
-
)
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
interface Props {
|
|
34
|
-
size: 'sm' | 'md' | 'lg'
|
|
35
|
-
disabled?: boolean
|
|
36
|
-
required?: boolean
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const DateInputControl = ({ size, disabled, required }: Props) => {
|
|
40
|
-
const [value, onChange] = useState({ month: 0, year: 0, day: 0 })
|
|
41
|
-
|
|
42
|
-
return (
|
|
43
|
-
<DateInput value={value} size={size} onChange={onChange} disabled={disabled} required={required} />
|
|
44
|
-
)
|
|
45
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { DatePicker } from '@/DatePicker'
|
|
2
|
-
import { Icon } from '@/Icon'
|
|
3
|
-
import { faCalendar } from '@fortawesome/free-solid-svg-icons'
|
|
4
|
-
import { useState } from 'react'
|
|
5
|
-
|
|
6
|
-
export const DatePickerExample = () => {
|
|
7
|
-
return (
|
|
8
|
-
<div className="flex flex-col gap-14">
|
|
9
|
-
<div className="flex items-center gap-40">
|
|
10
|
-
<div style={{ width: '340px' }}>
|
|
11
|
-
<DatePickerControl size="md" />
|
|
12
|
-
</div>
|
|
13
|
-
</div>
|
|
14
|
-
</div>
|
|
15
|
-
)
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
interface Props {
|
|
19
|
-
size: 'sm' | 'md' | 'lg'
|
|
20
|
-
disabled?: boolean
|
|
21
|
-
required?: boolean
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export const DatePickerControl = ({ size, disabled, required }: Props) => {
|
|
25
|
-
const [value, onChange] = useState<null | Date>(new Date())
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<DatePicker
|
|
29
|
-
fill
|
|
30
|
-
clearButton
|
|
31
|
-
leftElement={<Icon icon={faCalendar} size="xxs" className="form-space-margin" />}
|
|
32
|
-
value={value}
|
|
33
|
-
size={size}
|
|
34
|
-
onChange={onChange}
|
|
35
|
-
disabled={disabled}
|
|
36
|
-
required={required}
|
|
37
|
-
placeholder="Укажите дату"
|
|
38
|
-
disableFuture
|
|
39
|
-
/>
|
|
40
|
-
)
|
|
41
|
-
}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { Button, ButtonProps } from '@/Button'
|
|
2
|
-
import { useState } from 'react'
|
|
3
|
-
import { Dialog, DialogProps } from '@/Dialog'
|
|
4
|
-
|
|
5
|
-
export const DialogExample = () => {
|
|
6
|
-
return (
|
|
7
|
-
<div className="row-group">
|
|
8
|
-
<DialogControlled buttonProps={{ text: 'Open dialog' }}>
|
|
9
|
-
{() => (
|
|
10
|
-
<div className="flex flex-col p-20 overflow-hidden">
|
|
11
|
-
<div className="overflow-y-scroll">
|
|
12
|
-
<b>
|
|
13
|
-
Data integration is the seminal problem of the digital age. For over ten years, we ve
|
|
14
|
-
helped the worlds premier organizations rise to the challenge.
|
|
15
|
-
</b>
|
|
16
|
-
<div>
|
|
17
|
-
Palantir Foundry radically reimagines the way enterprises interact with data by
|
|
18
|
-
amplifying and extending the power of data integration. With Foundry, anyone can source,
|
|
19
|
-
fuse, and transform data into any shape they desire. Business analysts become data
|
|
20
|
-
engineers — and leaders in their organizations data revolution.
|
|
21
|
-
</div>
|
|
22
|
-
</div>
|
|
23
|
-
<div className="w-full pt-20">
|
|
24
|
-
<DialogControlled buttonProps={{ fill: true }}>
|
|
25
|
-
{({ close }) => (
|
|
26
|
-
<div className="p-20">
|
|
27
|
-
<Button onClick={close}>Close me</Button>
|
|
28
|
-
</div>
|
|
29
|
-
)}
|
|
30
|
-
</DialogControlled>
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
33
|
-
)}
|
|
34
|
-
</DialogControlled>
|
|
35
|
-
<DialogControlled size="full" buttonProps={{ text: 'Open full-size dialog' }}>
|
|
36
|
-
{() => (
|
|
37
|
-
<div className="flex flex-col h-full justify-between p-20 overflow-hidden">
|
|
38
|
-
<div className="overflow-y-scroll">
|
|
39
|
-
<b>
|
|
40
|
-
Data integration is the seminal problem of the digital age. For over ten years, we ve
|
|
41
|
-
helped the worlds premier organizations rise to the challenge.
|
|
42
|
-
</b>
|
|
43
|
-
<div>
|
|
44
|
-
Palantir Foundry radically reimagines the way enterprises interact with data by
|
|
45
|
-
amplifying and extending the power of data integration. With Foundry, anyone can source,
|
|
46
|
-
fuse, and transform data into any shape they desire. Business analysts become data
|
|
47
|
-
engineers — and leaders in their organizations data revolution.
|
|
48
|
-
</div>
|
|
49
|
-
</div>
|
|
50
|
-
<div className="w-full pt-20">
|
|
51
|
-
<DialogControlled buttonProps={{ fill: true }}>
|
|
52
|
-
{({ close }) => (
|
|
53
|
-
<div className="p-20">
|
|
54
|
-
<Button onClick={close}>Close me</Button>
|
|
55
|
-
</div>
|
|
56
|
-
)}
|
|
57
|
-
</DialogControlled>
|
|
58
|
-
</div>
|
|
59
|
-
</div>
|
|
60
|
-
)}
|
|
61
|
-
</DialogControlled>
|
|
62
|
-
</div>
|
|
63
|
-
)
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
interface Props extends Pick<DialogProps, 'size'> {
|
|
67
|
-
buttonProps?: ButtonProps
|
|
68
|
-
children: (value: { close: () => void }) => JSX.Element
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
const DialogControlled = ({ size, children, buttonProps }: Props) => {
|
|
72
|
-
const [open, setOpen] = useState(false)
|
|
73
|
-
|
|
74
|
-
return (
|
|
75
|
-
<>
|
|
76
|
-
<Button {...buttonProps} onClick={() => setOpen(true)}>
|
|
77
|
-
Open dialog
|
|
78
|
-
</Button>
|
|
79
|
-
<Dialog open={open} onOpenChange={setOpen} size={size}>
|
|
80
|
-
<Dialog.Close className="dialog-close">
|
|
81
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
|
|
82
|
-
<path
|
|
83
|
-
fill="currentColor"
|
|
84
|
-
d="M14.03 3.03 9.06 8l4.97 4.97-1.061 1.06-4.97-4.97-4.97 4.97-1.06-1.06L6.939 8l-4.97-4.97 1.06-1.06L8 6.94l4.97-4.97z"
|
|
85
|
-
/>
|
|
86
|
-
</svg>
|
|
87
|
-
</Dialog.Close>
|
|
88
|
-
{children({ close: () => setOpen(false) })}
|
|
89
|
-
</Dialog>
|
|
90
|
-
</>
|
|
91
|
-
)
|
|
92
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { Button } from '@/Button'
|
|
2
|
-
import { createAlertAgent } from '@/DialogAlert'
|
|
3
|
-
import { Icon } from '@/Icon'
|
|
4
|
-
import { faWifi } from '@fortawesome/free-solid-svg-icons'
|
|
5
|
-
|
|
6
|
-
const AlertAgent = createAlertAgent({ cancelDefaultText: 'Cancel' })
|
|
7
|
-
|
|
8
|
-
export const DialogAlertExample = () => {
|
|
9
|
-
return (
|
|
10
|
-
<div className="row-group">
|
|
11
|
-
<Button
|
|
12
|
-
onClick={() => {
|
|
13
|
-
AlertAgent.show({
|
|
14
|
-
title: 'Are you sure?',
|
|
15
|
-
confirm: { text: 'Move to trash' },
|
|
16
|
-
description: `Are you sure you want to move filename to Trash? You will be able to restore it later, but it will become private to you`
|
|
17
|
-
})
|
|
18
|
-
}}
|
|
19
|
-
>
|
|
20
|
-
Move to trash
|
|
21
|
-
</Button>
|
|
22
|
-
<Button
|
|
23
|
-
onClick={() => {
|
|
24
|
-
AlertAgent.show({
|
|
25
|
-
cancel: { text: 'Okay' },
|
|
26
|
-
description: `Couldn't create the file because the containing folder doesn't exist anymore. You will be redirected to your user folder`
|
|
27
|
-
})
|
|
28
|
-
}}
|
|
29
|
-
>
|
|
30
|
-
Do unable
|
|
31
|
-
</Button>
|
|
32
|
-
<Button
|
|
33
|
-
onClick={() => {
|
|
34
|
-
AlertAgent.show({
|
|
35
|
-
disableCancel: true,
|
|
36
|
-
icon: <Icon icon={faWifi} />,
|
|
37
|
-
confirm: { text: 'Reload', appearance: 'neutral', onClick: () => window.location.reload() },
|
|
38
|
-
description: `Connection is interupted. Page will be reloaded`
|
|
39
|
-
})
|
|
40
|
-
}}
|
|
41
|
-
>
|
|
42
|
-
Reconnecting
|
|
43
|
-
</Button>
|
|
44
|
-
<AlertAgent.Viewport />
|
|
45
|
-
</div>
|
|
46
|
-
)
|
|
47
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { Button } from '@/Button'
|
|
2
|
-
import { Drawer, DrawerProps } from '@/Drawer'
|
|
3
|
-
import { useState } from 'react'
|
|
4
|
-
|
|
5
|
-
const direction = ['left', 'top', 'bottom', 'right'] as const
|
|
6
|
-
|
|
7
|
-
export const DrawerExample = () => {
|
|
8
|
-
return (
|
|
9
|
-
<div className="row-group">
|
|
10
|
-
{direction.map((direction) => (
|
|
11
|
-
<DrawerControlled
|
|
12
|
-
direction={direction}
|
|
13
|
-
key={`drawer-${direction}`}
|
|
14
|
-
size="40%"
|
|
15
|
-
button={<span className="capitalize">{direction} Drawer</span>}
|
|
16
|
-
>
|
|
17
|
-
{() => (
|
|
18
|
-
<div className="flex flex-col overflow-hidden">
|
|
19
|
-
<div className="overflow-y-scroll p-20">
|
|
20
|
-
<b>
|
|
21
|
-
Data integration is the seminal problem of the digital age. For over ten years, we ve
|
|
22
|
-
helped the worlds premier organizations rise to the challenge.
|
|
23
|
-
</b>
|
|
24
|
-
<div>
|
|
25
|
-
Palantir Foundry radically reimagines the way enterprises interact with data by
|
|
26
|
-
amplifying and extending the power of data integration. With Foundry, anyone can
|
|
27
|
-
source, fuse, and transform data into any shape they desire. Business analysts become
|
|
28
|
-
data engineers — and leaders in their organizations data revolution.
|
|
29
|
-
</div>
|
|
30
|
-
</div>
|
|
31
|
-
</div>
|
|
32
|
-
)}
|
|
33
|
-
</DrawerControlled>
|
|
34
|
-
))}
|
|
35
|
-
</div>
|
|
36
|
-
)
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
interface Props extends Omit<DrawerProps, 'open' | 'onOpenChange' | 'children'> {
|
|
40
|
-
children: (value: { close: () => void }) => JSX.Element
|
|
41
|
-
button: React.ReactNode
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const DrawerControlled = ({ children, button, ...props }: Props) => {
|
|
45
|
-
const [open, setOpen] = useState(false)
|
|
46
|
-
|
|
47
|
-
return (
|
|
48
|
-
<>
|
|
49
|
-
<Button onClick={() => setOpen(true)}>{button}</Button>
|
|
50
|
-
<Drawer open={open} onOpenChange={setOpen} {...props}>
|
|
51
|
-
{children({ close: () => setOpen(false) })}
|
|
52
|
-
</Drawer>
|
|
53
|
-
</>
|
|
54
|
-
)
|
|
55
|
-
}
|
package/playground/index.css
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
@layer theme, base, components, utilities;
|
|
2
|
-
|
|
3
|
-
@import 'tailwindcss/theme.css' layer(theme);
|
|
4
|
-
@import 'tailwindcss/preflight.css' layer(base);
|
|
5
|
-
@import 'tailwindcss/utilities.css' layer(utilities);
|
|
6
|
-
|
|
7
|
-
/* @import 'tailwindcss'; */
|
|
8
|
-
@config "../tailwind.config.js";
|
|
9
|
-
|
|
10
|
-
.center {
|
|
11
|
-
@apply flex items-center justify-center;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.full {
|
|
15
|
-
@apply h-full w-full;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.image {
|
|
19
|
-
@apply h-full w-full bg-cover bg-center;
|
|
20
|
-
background-color: #3d3d3d17;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.quiet {
|
|
24
|
-
@apply opacity-75;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.quieter {
|
|
28
|
-
@apply opacity-50;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.all-0 {
|
|
32
|
-
@apply bottom-0 left-0 right-0 top-0;
|
|
33
|
-
}
|