@mrpelz/uikit-ish 0.0.0-stage → 7.8.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/dist/components/action-sheet/main.d.ts +39 -0
- package/dist/components/action-sheet/main.d.ts.map +1 -0
- package/dist/components/action-sheet/main.js +35 -0
- package/dist/components/action-sheet/main.js.map +1 -0
- package/dist/components/action-sheet/props.d.ts +10 -0
- package/dist/components/action-sheet/props.d.ts.map +1 -0
- package/dist/components/action-sheet/props.js +2 -0
- package/dist/components/action-sheet/props.js.map +1 -0
- package/dist/components/action-sheet/style.css +8 -0
- package/dist/components/activity-view/main.d.ts +45 -0
- package/dist/components/activity-view/main.d.ts.map +1 -0
- package/dist/components/activity-view/main.js +64 -0
- package/dist/components/activity-view/main.js.map +1 -0
- package/dist/components/activity-view/props.d.ts +12 -0
- package/dist/components/activity-view/props.d.ts.map +1 -0
- package/dist/components/activity-view/props.js +2 -0
- package/dist/components/activity-view/props.js.map +1 -0
- package/dist/components/activity-view/style.css +209 -0
- package/dist/components/alert/main.d.ts +53 -0
- package/dist/components/alert/main.d.ts.map +1 -0
- package/dist/components/alert/main.js +57 -0
- package/dist/components/alert/main.js.map +1 -0
- package/dist/components/alert/props.d.ts +18 -0
- package/dist/components/alert/props.d.ts.map +1 -0
- package/dist/components/alert/props.js +2 -0
- package/dist/components/alert/props.js.map +1 -0
- package/dist/components/alert/style.css +205 -0
- package/dist/components/avatar/main.d.ts +20 -0
- package/dist/components/avatar/main.d.ts.map +1 -0
- package/dist/components/avatar/main.js +42 -0
- package/dist/components/avatar/main.js.map +1 -0
- package/dist/components/avatar/props.d.ts +18 -0
- package/dist/components/avatar/props.d.ts.map +1 -0
- package/dist/components/avatar/props.js +2 -0
- package/dist/components/avatar/props.js.map +1 -0
- package/dist/components/avatar/style.css +83 -0
- package/dist/components/badge/main.d.ts +12 -0
- package/dist/components/badge/main.d.ts.map +1 -0
- package/dist/components/badge/main.js +33 -0
- package/dist/components/badge/main.js.map +1 -0
- package/dist/components/badge/props.d.ts +20 -0
- package/dist/components/badge/props.d.ts.map +1 -0
- package/dist/components/badge/props.js +2 -0
- package/dist/components/badge/props.js.map +1 -0
- package/dist/components/badge/style.css +71 -0
- package/dist/components/button/main.d.ts +16 -0
- package/dist/components/button/main.d.ts.map +1 -0
- package/dist/components/button/main.js +64 -0
- package/dist/components/button/main.js.map +1 -0
- package/dist/components/button/props.d.ts +45 -0
- package/dist/components/button/props.d.ts.map +1 -0
- package/dist/components/button/props.js +2 -0
- package/dist/components/button/props.js.map +1 -0
- package/dist/components/button/style.css +338 -0
- package/dist/components/checkbox/main.d.ts +23 -0
- package/dist/components/checkbox/main.d.ts.map +1 -0
- package/dist/components/checkbox/main.js +43 -0
- package/dist/components/checkbox/main.js.map +1 -0
- package/dist/components/checkbox/props.d.ts +14 -0
- package/dist/components/checkbox/props.d.ts.map +1 -0
- package/dist/components/checkbox/props.js +2 -0
- package/dist/components/checkbox/props.js.map +1 -0
- package/dist/components/checkbox/style.css +73 -0
- package/dist/components/color-picker/main.d.ts +31 -0
- package/dist/components/color-picker/main.d.ts.map +1 -0
- package/dist/components/color-picker/main.js +356 -0
- package/dist/components/color-picker/main.js.map +1 -0
- package/dist/components/color-picker/props.d.ts +61 -0
- package/dist/components/color-picker/props.d.ts.map +1 -0
- package/dist/components/color-picker/props.js +2 -0
- package/dist/components/color-picker/props.js.map +1 -0
- package/dist/components/color-picker/style.css +374 -0
- package/dist/components/contextual-menu/main.d.ts +84 -0
- package/dist/components/contextual-menu/main.d.ts.map +1 -0
- package/dist/components/contextual-menu/main.js +255 -0
- package/dist/components/contextual-menu/main.js.map +1 -0
- package/dist/components/contextual-menu/props.d.ts +44 -0
- package/dist/components/contextual-menu/props.d.ts.map +1 -0
- package/dist/components/contextual-menu/props.js +2 -0
- package/dist/components/contextual-menu/props.js.map +1 -0
- package/dist/components/contextual-menu/style.css +80 -0
- package/dist/components/date-picker/main.d.ts +57 -0
- package/dist/components/date-picker/main.d.ts.map +1 -0
- package/dist/components/date-picker/main.js +770 -0
- package/dist/components/date-picker/main.js.map +1 -0
- package/dist/components/date-picker/props.d.ts +220 -0
- package/dist/components/date-picker/props.d.ts.map +1 -0
- package/dist/components/date-picker/props.js +2 -0
- package/dist/components/date-picker/props.js.map +1 -0
- package/dist/components/date-picker/style.css +446 -0
- package/dist/components/edit-menu/main.d.ts +71 -0
- package/dist/components/edit-menu/main.d.ts.map +1 -0
- package/dist/components/edit-menu/main.js +317 -0
- package/dist/components/edit-menu/main.js.map +1 -0
- package/dist/components/edit-menu/props.d.ts +21 -0
- package/dist/components/edit-menu/props.d.ts.map +1 -0
- package/dist/components/edit-menu/props.js +2 -0
- package/dist/components/edit-menu/props.js.map +1 -0
- package/dist/components/edit-menu/style.css +189 -0
- package/dist/components/form/main.d.ts +21 -0
- package/dist/components/form/main.d.ts.map +1 -0
- package/dist/components/form/main.js +32 -0
- package/dist/components/form/main.js.map +1 -0
- package/dist/components/form/props.d.ts +4 -0
- package/dist/components/form/props.d.ts.map +1 -0
- package/dist/components/form/props.js +2 -0
- package/dist/components/form/props.js.map +1 -0
- package/dist/components/form/style.css +9 -0
- package/dist/components/glass/main.d.ts +34 -0
- package/dist/components/glass/main.d.ts.map +1 -0
- package/dist/components/glass/main.js +157 -0
- package/dist/components/glass/main.js.map +1 -0
- package/dist/components/glass/props.d.ts +22 -0
- package/dist/components/glass/props.d.ts.map +1 -0
- package/dist/components/glass/props.js +2 -0
- package/dist/components/glass/props.js.map +1 -0
- package/dist/components/glass/style.css +488 -0
- package/dist/components/header/main.d.ts +15 -0
- package/dist/components/header/main.d.ts.map +1 -0
- package/dist/components/header/main.js +78 -0
- package/dist/components/header/main.js.map +1 -0
- package/dist/components/header/props.d.ts +16 -0
- package/dist/components/header/props.d.ts.map +1 -0
- package/dist/components/header/props.js +2 -0
- package/dist/components/header/props.js.map +1 -0
- package/dist/components/header/style.css +119 -0
- package/dist/components/index.d.ts +38 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +45 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/layout/main.d.ts +15 -0
- package/dist/components/layout/main.d.ts.map +1 -0
- package/dist/components/layout/main.js +241 -0
- package/dist/components/layout/main.js.map +1 -0
- package/dist/components/layout/props.d.ts +52 -0
- package/dist/components/layout/props.d.ts.map +1 -0
- package/dist/components/layout/props.js +2 -0
- package/dist/components/layout/props.js.map +1 -0
- package/dist/components/layout/style.css +208 -0
- package/dist/components/list/main.d.ts +104 -0
- package/dist/components/list/main.d.ts.map +1 -0
- package/dist/components/list/main.js +1553 -0
- package/dist/components/list/main.js.map +1 -0
- package/dist/components/list/props.d.ts +178 -0
- package/dist/components/list/props.d.ts.map +1 -0
- package/dist/components/list/props.js +2 -0
- package/dist/components/list/props.js.map +1 -0
- package/dist/components/list/style.css +1689 -0
- package/dist/components/menu/main.d.ts +119 -0
- package/dist/components/menu/main.d.ts.map +1 -0
- package/dist/components/menu/main.js +487 -0
- package/dist/components/menu/main.js.map +1 -0
- package/dist/components/menu/props.d.ts +54 -0
- package/dist/components/menu/props.d.ts.map +1 -0
- package/dist/components/menu/props.js +2 -0
- package/dist/components/menu/props.js.map +1 -0
- package/dist/components/menu/style.css +446 -0
- package/dist/components/navigation/main.d.ts +9 -0
- package/dist/components/navigation/main.d.ts.map +1 -0
- package/dist/components/navigation/main.js +201 -0
- package/dist/components/navigation/main.js.map +1 -0
- package/dist/components/navigation/props.d.ts +16 -0
- package/dist/components/navigation/props.d.ts.map +1 -0
- package/dist/components/navigation/props.js +2 -0
- package/dist/components/navigation/props.js.map +1 -0
- package/dist/components/navigation/style.css +83 -0
- package/dist/components/page/main.d.ts +9 -0
- package/dist/components/page/main.d.ts.map +1 -0
- package/dist/components/page/main.js +20 -0
- package/dist/components/page/main.js.map +1 -0
- package/dist/components/page/props.d.ts +10 -0
- package/dist/components/page/props.d.ts.map +1 -0
- package/dist/components/page/props.js +2 -0
- package/dist/components/page/props.js.map +1 -0
- package/dist/components/page/style.css +19 -0
- package/dist/components/page-control/main.d.ts +13 -0
- package/dist/components/page-control/main.d.ts.map +1 -0
- package/dist/components/page-control/main.js +138 -0
- package/dist/components/page-control/main.js.map +1 -0
- package/dist/components/page-control/props.d.ts +36 -0
- package/dist/components/page-control/props.d.ts.map +1 -0
- package/dist/components/page-control/props.js +2 -0
- package/dist/components/page-control/props.js.map +1 -0
- package/dist/components/page-control/style.css +111 -0
- package/dist/components/popover/main.d.ts +34 -0
- package/dist/components/popover/main.d.ts.map +1 -0
- package/dist/components/popover/main.js +232 -0
- package/dist/components/popover/main.js.map +1 -0
- package/dist/components/popover/props.d.ts +23 -0
- package/dist/components/popover/props.d.ts.map +1 -0
- package/dist/components/popover/props.js +2 -0
- package/dist/components/popover/props.js.map +1 -0
- package/dist/components/popover/style.css +160 -0
- package/dist/components/progress/main.d.ts +31 -0
- package/dist/components/progress/main.d.ts.map +1 -0
- package/dist/components/progress/main.js +77 -0
- package/dist/components/progress/main.js.map +1 -0
- package/dist/components/progress/props.d.ts +56 -0
- package/dist/components/progress/props.d.ts.map +1 -0
- package/dist/components/progress/props.js +2 -0
- package/dist/components/progress/props.js.map +1 -0
- package/dist/components/progress/style.css +264 -0
- package/dist/components/roll/main.d.ts +18 -0
- package/dist/components/roll/main.d.ts.map +1 -0
- package/dist/components/roll/main.js +463 -0
- package/dist/components/roll/main.js.map +1 -0
- package/dist/components/roll/props.d.ts +58 -0
- package/dist/components/roll/props.d.ts.map +1 -0
- package/dist/components/roll/props.js +2 -0
- package/dist/components/roll/props.js.map +1 -0
- package/dist/components/roll/style.css +173 -0
- package/dist/components/segmented/main.d.ts +17 -0
- package/dist/components/segmented/main.d.ts.map +1 -0
- package/dist/components/segmented/main.js +151 -0
- package/dist/components/segmented/main.js.map +1 -0
- package/dist/components/segmented/props.d.ts +16 -0
- package/dist/components/segmented/props.d.ts.map +1 -0
- package/dist/components/segmented/props.js +2 -0
- package/dist/components/segmented/props.js.map +1 -0
- package/dist/components/segmented/style.css +428 -0
- package/dist/components/sheet/main.d.ts +32 -0
- package/dist/components/sheet/main.d.ts.map +1 -0
- package/dist/components/sheet/main.js +101 -0
- package/dist/components/sheet/main.js.map +1 -0
- package/dist/components/sheet/props.d.ts +11 -0
- package/dist/components/sheet/props.d.ts.map +1 -0
- package/dist/components/sheet/props.js +2 -0
- package/dist/components/sheet/props.js.map +1 -0
- package/dist/components/sheet/style.css +125 -0
- package/dist/components/sidebar/main.d.ts +15 -0
- package/dist/components/sidebar/main.d.ts.map +1 -0
- package/dist/components/sidebar/main.js +42 -0
- package/dist/components/sidebar/main.js.map +1 -0
- package/dist/components/sidebar/props.d.ts +5 -0
- package/dist/components/sidebar/props.d.ts.map +1 -0
- package/dist/components/sidebar/props.js +2 -0
- package/dist/components/sidebar/props.js.map +1 -0
- package/dist/components/sidebar/style.css +94 -0
- package/dist/components/slider/main.d.ts +35 -0
- package/dist/components/slider/main.d.ts.map +1 -0
- package/dist/components/slider/main.js +153 -0
- package/dist/components/slider/main.js.map +1 -0
- package/dist/components/slider/props.d.ts +56 -0
- package/dist/components/slider/props.d.ts.map +1 -0
- package/dist/components/slider/props.js +2 -0
- package/dist/components/slider/props.js.map +1 -0
- package/dist/components/slider/style.css +345 -0
- package/dist/components/stepper/main.d.ts +22 -0
- package/dist/components/stepper/main.d.ts.map +1 -0
- package/dist/components/stepper/main.js +56 -0
- package/dist/components/stepper/main.js.map +1 -0
- package/dist/components/stepper/props.d.ts +10 -0
- package/dist/components/stepper/props.d.ts.map +1 -0
- package/dist/components/stepper/props.js +2 -0
- package/dist/components/stepper/props.js.map +1 -0
- package/dist/components/stepper/style.css +115 -0
- package/dist/components/switch/main.d.ts +14 -0
- package/dist/components/switch/main.d.ts.map +1 -0
- package/dist/components/switch/main.js +143 -0
- package/dist/components/switch/main.js.map +1 -0
- package/dist/components/switch/props.d.ts +34 -0
- package/dist/components/switch/props.d.ts.map +1 -0
- package/dist/components/switch/props.js +2 -0
- package/dist/components/switch/props.js.map +1 -0
- package/dist/components/switch/style.css +168 -0
- package/dist/components/symbol/main.d.ts +8 -0
- package/dist/components/symbol/main.d.ts.map +1 -0
- package/dist/components/symbol/main.js +32 -0
- package/dist/components/symbol/main.js.map +1 -0
- package/dist/components/symbol/props.d.ts +10 -0
- package/dist/components/symbol/props.d.ts.map +1 -0
- package/dist/components/symbol/props.js +2 -0
- package/dist/components/symbol/props.js.map +1 -0
- package/dist/components/symbol/style.css +26 -0
- package/dist/components/tab-bar/main.d.ts +39 -0
- package/dist/components/tab-bar/main.d.ts.map +1 -0
- package/dist/components/tab-bar/main.js +1133 -0
- package/dist/components/tab-bar/main.js.map +1 -0
- package/dist/components/tab-bar/props.d.ts +152 -0
- package/dist/components/tab-bar/props.d.ts.map +1 -0
- package/dist/components/tab-bar/props.js +2 -0
- package/dist/components/tab-bar/props.js.map +1 -0
- package/dist/components/tab-bar/style.css +936 -0
- package/dist/components/text-field/main.d.ts +28 -0
- package/dist/components/text-field/main.d.ts.map +1 -0
- package/dist/components/text-field/main.js +105 -0
- package/dist/components/text-field/main.js.map +1 -0
- package/dist/components/text-field/props.d.ts +3 -0
- package/dist/components/text-field/props.d.ts.map +1 -0
- package/dist/components/text-field/props.js +2 -0
- package/dist/components/text-field/props.js.map +1 -0
- package/dist/components/text-field/style.css +230 -0
- package/dist/components/toolbar/main.d.ts +37 -0
- package/dist/components/toolbar/main.d.ts.map +1 -0
- package/dist/components/toolbar/main.js +142 -0
- package/dist/components/toolbar/main.js.map +1 -0
- package/dist/components/toolbar/props.d.ts +46 -0
- package/dist/components/toolbar/props.d.ts.map +1 -0
- package/dist/components/toolbar/props.js +2 -0
- package/dist/components/toolbar/props.js.map +1 -0
- package/dist/components/toolbar/style.css +210 -0
- package/dist/components/tooltip/main.d.ts +29 -0
- package/dist/components/tooltip/main.d.ts.map +1 -0
- package/dist/components/tooltip/main.js +37 -0
- package/dist/components/tooltip/main.js.map +1 -0
- package/dist/components/tooltip/props.d.ts +11 -0
- package/dist/components/tooltip/props.d.ts.map +1 -0
- package/dist/components/tooltip/props.js +2 -0
- package/dist/components/tooltip/props.js.map +1 -0
- package/dist/components/tooltip/style.css +29 -0
- package/dist/components/typography/main.d.ts +8 -0
- package/dist/components/typography/main.d.ts.map +1 -0
- package/dist/components/typography/main.js +21 -0
- package/dist/components/typography/main.js.map +1 -0
- package/dist/components/typography/props.d.ts +35 -0
- package/dist/components/typography/props.d.ts.map +1 -0
- package/dist/components/typography/props.js +2 -0
- package/dist/components/typography/props.js.map +1 -0
- package/dist/components/typography/style.css +719 -0
- package/dist/components/utils/main.d.ts +114 -0
- package/dist/components/utils/main.d.ts.map +1 -0
- package/dist/components/utils/main.js +431 -0
- package/dist/components/utils/main.js.map +1 -0
- package/dist/components/utils/props.d.ts +52 -0
- package/dist/components/utils/props.d.ts.map +1 -0
- package/dist/components/utils/props.js +2 -0
- package/dist/components/utils/props.js.map +1 -0
- package/dist/components/utils/style.css +77 -0
- package/dist/components/viewport/main.d.ts +32 -0
- package/dist/components/viewport/main.d.ts.map +1 -0
- package/dist/components/viewport/main.js +197 -0
- package/dist/components/viewport/main.js.map +1 -0
- package/dist/components/viewport/props.d.ts +71 -0
- package/dist/components/viewport/props.d.ts.map +1 -0
- package/dist/components/viewport/props.js +2 -0
- package/dist/components/viewport/props.js.map +1 -0
- package/dist/components/viewport/style.css +112 -0
- package/dist/main.d.ts +4 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +3 -0
- package/dist/main.js.map +1 -0
- package/dist/styles.css +567 -0
- package/dist/styles.d.ts +25 -0
- package/dist/styles.d.ts.map +1 -0
- package/dist/styles.js +39 -0
- package/dist/styles.js.map +1 -0
- package/package.json +55 -4
- package/README.md +0 -3
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { ButtonProps as BaseButtonProps } from '@base-ui/react/button';
|
|
2
|
+
import type { Properties } from 'csstype';
|
|
3
|
+
import type { GlassContextValue } from '../glass/main.js';
|
|
4
|
+
import type { SecondaryClickProps } from '../utils/main.js';
|
|
5
|
+
export type ButtonRootProps = BaseButtonProps & SecondaryClickProps & {
|
|
6
|
+
/**
|
|
7
|
+
* Brightness behind glass variants (`adaptive`: by what's behind it).
|
|
8
|
+
* @default follows the color scheme
|
|
9
|
+
*/
|
|
10
|
+
context?: GlassContextValue;
|
|
11
|
+
/**
|
|
12
|
+
* The cursor (where the pointer hovers).
|
|
13
|
+
* @default 'pointer' (disabled, also without a click handler: 'not-allowed')
|
|
14
|
+
*/
|
|
15
|
+
cursor?: Properties['cursor'];
|
|
16
|
+
/** Figma “Destructive”: tints the button red. */
|
|
17
|
+
destructive?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Grows to fill the available width (a block, or a flex item sharing a
|
|
20
|
+
* row's free space), its content centered (Figma: hugging its content).
|
|
21
|
+
*/
|
|
22
|
+
fill?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* `circle` is square with a round shape, for symbol-only buttons;
|
|
25
|
+
* `roundedRectangle` has 6px corners (large: 12px; Figma “Date and time -
|
|
26
|
+
* Collapsed”, large borderless buttons).
|
|
27
|
+
*/
|
|
28
|
+
shape?: 'capsule' | 'circle' | 'roundedRectangle';
|
|
29
|
+
/** Figma “Size” (not applicable to glass variants, which have one size). */
|
|
30
|
+
size?: 'large' | 'medium' | 'small';
|
|
31
|
+
/**
|
|
32
|
+
* Its text and symbols' color, over its variant's (e.g. for a light
|
|
33
|
+
* `tint` behind them; unblended on glass).
|
|
34
|
+
*/
|
|
35
|
+
textColor?: string;
|
|
36
|
+
/**
|
|
37
|
+
* The button's color (labels, fills, tinted glass; UIKit `tintColor`, e.g.
|
|
38
|
+
* Notes' yellow). `destructive` wins.
|
|
39
|
+
* @default the primary color
|
|
40
|
+
*/
|
|
41
|
+
tint?: string;
|
|
42
|
+
/** Figma “Style”, and “Button - Liquid Glass” with “Tinted”. */
|
|
43
|
+
variant?: 'bordered' | 'bordered-prominent' | 'bordered-secondary' | 'borderless' | 'glass' | 'glass-prominent';
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/components/button/props.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE5D,MAAM,MAAM,eAAe,GAAG,eAAe,GAC3C,mBAAmB,GAAG;IACpB;;;OAGG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B;;;OAGG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC9B,iDAAiD;IACjD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,kBAAkB,CAAC;IAClD,4EAA4E;IAC5E,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gEAAgE;IAChE,OAAO,CAAC,EACJ,UAAU,GACV,oBAAoB,GACpB,oBAAoB,GACpB,YAAY,GACZ,OAAO,GACP,iBAAiB,CAAC;CACvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.js","sourceRoot":"","sources":["../../../src/components/button/props.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
/* Button (see main.tsx). */
|
|
2
|
+
@layer uikit-ish {
|
|
3
|
+
/*
|
|
4
|
+
* Source: Apple iOS 26 Figma (Button: Size, Style, Label Type, Enabled,
|
|
5
|
+
* Destructive; Button - Liquid Glass: Tinted, BG Context); see
|
|
6
|
+
* main.tsx. By its props as attributes: `data-fill`, `data-size`,
|
|
7
|
+
* `data-variant`, `data-destructive`, `data-shape` (in that order: later
|
|
8
|
+
* ones over earlier ones); `tint` and `textColor` as properties (inline).
|
|
9
|
+
*/
|
|
10
|
+
.uikit-button-root {
|
|
11
|
+
--uikit-utils-cursor: attr(cursor type(<custom-ident>), pointer);
|
|
12
|
+
--uikit-button-tint: var(--color-ios-primary);
|
|
13
|
+
--uikit-button-background: transparent;
|
|
14
|
+
--uikit-button-background-disabled: var(--uikit-button-background);
|
|
15
|
+
--uikit-button-background-pressed: color-mix(
|
|
16
|
+
in srgb,
|
|
17
|
+
var(--uikit-button-background),
|
|
18
|
+
var(--uikit-button-color) 15%
|
|
19
|
+
);
|
|
20
|
+
--uikit-button-color: var(--uikit-button-tint);
|
|
21
|
+
--uikit-button-color-disabled: var(--color-ios-tertiary-label);
|
|
22
|
+
--uikit-button-blend: normal;
|
|
23
|
+
--uikit-button-radius: 1000px;
|
|
24
|
+
--uikit-button-size: 34px;
|
|
25
|
+
--uikit-button-icon-font-size: var(--font-ios-subheadline-size);
|
|
26
|
+
--uikit-button-font-weight: 400;
|
|
27
|
+
--uikit-button-icon-font-weight: 400;
|
|
28
|
+
--uikit-button-icon-line-height: var(--font-ios-subheadline-line-height);
|
|
29
|
+
--uikit-glass-outset: 0px;
|
|
30
|
+
|
|
31
|
+
position: relative;
|
|
32
|
+
display: inline-flex;
|
|
33
|
+
min-width: var(--uikit-button-size);
|
|
34
|
+
min-height: var(--uikit-button-size);
|
|
35
|
+
box-sizing: border-box;
|
|
36
|
+
align-items: center;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
padding: 7px 14px;
|
|
39
|
+
border: 0;
|
|
40
|
+
border-radius: var(--uikit-button-radius);
|
|
41
|
+
margin: 0;
|
|
42
|
+
appearance: none;
|
|
43
|
+
background-color: var(--uikit-button-background);
|
|
44
|
+
color: var(--uikit-button-color);
|
|
45
|
+
font-family: inherit;
|
|
46
|
+
font-size: var(--font-ios-subheadline-size);
|
|
47
|
+
font-variation-settings: 'wght' var(--uikit-button-font-weight);
|
|
48
|
+
font-weight: round(down, var(--uikit-button-font-weight), 100);
|
|
49
|
+
gap: 4px;
|
|
50
|
+
letter-spacing: var(--font-ios-subheadline-tracking);
|
|
51
|
+
line-height: var(--font-ios-subheadline-line-height);
|
|
52
|
+
stroke: currentcolor;
|
|
53
|
+
stroke-linejoin: round;
|
|
54
|
+
stroke-width: max(0px, (var(--uikit-button-font-weight) - 400) / 326 * 1px);
|
|
55
|
+
text-align: center;
|
|
56
|
+
text-decoration: none;
|
|
57
|
+
text-transform: none;
|
|
58
|
+
transition-duration: 100ms;
|
|
59
|
+
transition-property: background-color;
|
|
60
|
+
user-select: none;
|
|
61
|
+
vertical-align: middle;
|
|
62
|
+
white-space: nowrap;
|
|
63
|
+
|
|
64
|
+
--uikit-symbol-thinning: max(
|
|
65
|
+
0px,
|
|
66
|
+
(400 - var(--uikit-button-font-weight)) / 326 * 1px
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
@media (hover: hover) {
|
|
70
|
+
cursor: var(--uikit-utils-cursor);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&[data-fill] {
|
|
74
|
+
display: flex;
|
|
75
|
+
width: 100%;
|
|
76
|
+
flex: 1 1 auto;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&[data-size='large'] {
|
|
80
|
+
--uikit-button-size: 50px;
|
|
81
|
+
--uikit-button-icon-font-size: var(--font-ios-body-size);
|
|
82
|
+
--uikit-button-icon-line-height: var(--font-ios-body-line-height);
|
|
83
|
+
|
|
84
|
+
padding: 14px 20px;
|
|
85
|
+
font-size: var(--font-ios-body-size);
|
|
86
|
+
letter-spacing: var(--font-ios-body-tracking);
|
|
87
|
+
line-height: var(--font-ios-body-line-height);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&[data-size='small'] {
|
|
91
|
+
--uikit-button-size: 28px;
|
|
92
|
+
|
|
93
|
+
padding: 4px 10px;
|
|
94
|
+
gap: 3px;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&[data-variant='bordered'],
|
|
98
|
+
&[data-variant='bordered-secondary'] {
|
|
99
|
+
--uikit-button-background: var(--color-ios-tertiary-system-fill);
|
|
100
|
+
--uikit-button-color: var(--uikit-button-tint);
|
|
101
|
+
--uikit-button-color-disabled: var(--color-ios-tertiary-label);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&[data-variant='bordered-secondary'] {
|
|
105
|
+
--uikit-button-color: var(--color-ios-label);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
&[data-variant='bordered'][data-destructive],
|
|
109
|
+
&[data-variant='bordered-secondary'][data-destructive] {
|
|
110
|
+
--uikit-button-background: color-mix(
|
|
111
|
+
in srgb,
|
|
112
|
+
var(--uikit-button-tint) 14%,
|
|
113
|
+
transparent
|
|
114
|
+
);
|
|
115
|
+
--uikit-button-color: var(--uikit-button-tint);
|
|
116
|
+
--uikit-button-color-disabled: color-mix(
|
|
117
|
+
in srgb,
|
|
118
|
+
var(--uikit-button-tint) 50%,
|
|
119
|
+
transparent
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
&[data-variant='bordered-prominent'] {
|
|
124
|
+
--uikit-button-background: var(--uikit-button-tint);
|
|
125
|
+
--uikit-button-background-disabled: color-mix(
|
|
126
|
+
in srgb,
|
|
127
|
+
var(--uikit-button-tint) 20%,
|
|
128
|
+
transparent
|
|
129
|
+
);
|
|
130
|
+
--uikit-button-color: rgb(255 255 255);
|
|
131
|
+
--uikit-button-color-disabled: rgb(255 255 255 / 30%);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/* Glass: its content in the glass' content color (prominent: tinted),
|
|
135
|
+
pressed a lens (see Source), its tinted glow behind it. */
|
|
136
|
+
&[data-variant='glass'],
|
|
137
|
+
&[data-variant='glass-prominent'] {
|
|
138
|
+
--uikit-button-size: 48px;
|
|
139
|
+
--uikit-button-background-pressed: transparent;
|
|
140
|
+
--uikit-button-color: var(--uikit-glass-content);
|
|
141
|
+
--uikit-button-color-disabled: var(--uikit-glass-content-disabled);
|
|
142
|
+
--uikit-button-blend: var(--uikit-glass-content-blend);
|
|
143
|
+
--uikit-button-icon-font-size: 19px;
|
|
144
|
+
--uikit-button-font-weight: 510;
|
|
145
|
+
--uikit-button-icon-font-weight: 590;
|
|
146
|
+
--uikit-button-icon-line-height: 22px;
|
|
147
|
+
|
|
148
|
+
padding: 6px 20px;
|
|
149
|
+
font-feature-settings: 'ss16';
|
|
150
|
+
font-size: 17px;
|
|
151
|
+
gap: 4px;
|
|
152
|
+
letter-spacing: 0;
|
|
153
|
+
line-height: 20px;
|
|
154
|
+
|
|
155
|
+
&::before {
|
|
156
|
+
position: absolute;
|
|
157
|
+
top: 50%;
|
|
158
|
+
left: 50%;
|
|
159
|
+
width: 1px;
|
|
160
|
+
height: 1px;
|
|
161
|
+
margin: -0.5px 0 0 -0.5px;
|
|
162
|
+
box-shadow: 0 0 40px 15px
|
|
163
|
+
color-mix(
|
|
164
|
+
in srgb,
|
|
165
|
+
var(--uikit-glass-tint, var(--glass-ios-tint)) 75%,
|
|
166
|
+
transparent
|
|
167
|
+
);
|
|
168
|
+
content: '';
|
|
169
|
+
opacity: var(--uikit-glass-pressed, 0);
|
|
170
|
+
transition-duration: var(--glass-ios-lens-duration);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
&[data-variant='glass-prominent'] {
|
|
175
|
+
--uikit-button-color: var(--uikit-glass-content-prominent);
|
|
176
|
+
--uikit-button-color-disabled: var(
|
|
177
|
+
--uikit-glass-content-prominent-disabled
|
|
178
|
+
);
|
|
179
|
+
--uikit-button-blend: var(--uikit-glass-content-prominent-blend);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
&[data-variant='borderless'] {
|
|
183
|
+
--uikit-button-radius: 40px;
|
|
184
|
+
|
|
185
|
+
&[data-destructive] {
|
|
186
|
+
--uikit-button-color-disabled: color-mix(
|
|
187
|
+
in srgb,
|
|
188
|
+
var(--uikit-button-tint) 50%,
|
|
189
|
+
transparent
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
&[data-size='large'] {
|
|
194
|
+
--uikit-button-radius: 12px;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/* Without a size: in its context's text style, if it gives one (e.g.
|
|
198
|
+
a list row's: Body, as its details; `--uikit-button-plain-*`),
|
|
199
|
+
otherwise Subheadline. Also its end margin (e.g. a list row's, its
|
|
200
|
+
content aligned with the row's details, its padding beyond them),
|
|
201
|
+
the gap of its label and symbol, and the symbol's weight; its
|
|
202
|
+
inline padding and pressed fill (e.g. a sidebar's toolbar's). */
|
|
203
|
+
&:not([data-size]) {
|
|
204
|
+
--uikit-button-icon-font-size: var(
|
|
205
|
+
--uikit-button-plain-size,
|
|
206
|
+
var(--font-ios-subheadline-size)
|
|
207
|
+
);
|
|
208
|
+
--uikit-button-icon-line-height: var(
|
|
209
|
+
--uikit-button-plain-line-height,
|
|
210
|
+
var(--font-ios-subheadline-line-height)
|
|
211
|
+
);
|
|
212
|
+
--uikit-button-icon-font-weight: var(
|
|
213
|
+
--uikit-button-plain-symbol-weight,
|
|
214
|
+
400
|
|
215
|
+
);
|
|
216
|
+
--uikit-button-background-pressed: var(
|
|
217
|
+
--uikit-button-plain-background-pressed,
|
|
218
|
+
color-mix(
|
|
219
|
+
in srgb,
|
|
220
|
+
var(--uikit-button-background),
|
|
221
|
+
var(--uikit-button-color) 15%
|
|
222
|
+
)
|
|
223
|
+
);
|
|
224
|
+
|
|
225
|
+
font-size: var(
|
|
226
|
+
--uikit-button-plain-size,
|
|
227
|
+
var(--font-ios-subheadline-size)
|
|
228
|
+
);
|
|
229
|
+
gap: var(--uikit-button-plain-gap, 4px);
|
|
230
|
+
letter-spacing: var(
|
|
231
|
+
--uikit-button-plain-tracking,
|
|
232
|
+
var(--font-ios-subheadline-tracking)
|
|
233
|
+
);
|
|
234
|
+
line-height: var(
|
|
235
|
+
--uikit-button-plain-line-height,
|
|
236
|
+
var(--font-ios-subheadline-line-height)
|
|
237
|
+
);
|
|
238
|
+
margin-inline-end: var(--uikit-button-plain-margin-end, 0);
|
|
239
|
+
padding-inline: var(--uikit-button-plain-padding-inline, 14px);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/* (Doubled: over the variants'.) */
|
|
244
|
+
&&[data-shape='circle'] {
|
|
245
|
+
--uikit-button-radius: 1000px;
|
|
246
|
+
--uikit-button-plain-padding-inline: 0px;
|
|
247
|
+
|
|
248
|
+
padding: 0;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
&&[data-shape='roundedRectangle'] {
|
|
252
|
+
--uikit-button-radius: 6px;
|
|
253
|
+
|
|
254
|
+
&[data-size='large'] {
|
|
255
|
+
--uikit-button-radius: 12px;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/* Hit region: at least 44×44px, centered. */
|
|
260
|
+
&::after {
|
|
261
|
+
position: absolute;
|
|
262
|
+
content: '';
|
|
263
|
+
inset: min(0px, calc(50% - 22px));
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
&:active:not([data-disabled]) {
|
|
267
|
+
--uikit-glass-pressed: 1;
|
|
268
|
+
--uikit-glass-scale: var(--glass-ios-lens-scale);
|
|
269
|
+
--uikit-button-content-scale: var(--glass-ios-lens-content-scale);
|
|
270
|
+
|
|
271
|
+
background-color: var(--uikit-button-background-pressed);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
&[data-disabled] {
|
|
275
|
+
--uikit-utils-cursor: attr(cursor type(<custom-ident>), not-allowed);
|
|
276
|
+
|
|
277
|
+
background-color: var(--uikit-button-background-disabled);
|
|
278
|
+
color: var(--uikit-button-color-disabled);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/* Blended and scaled as a whole; with symbols, its parts are (a symbol:
|
|
283
|
+
its glyph, see Symbol), so the symbols' badges are neither. */
|
|
284
|
+
.uikit-button-content {
|
|
285
|
+
--uikit-symbol-blend: var(--uikit-button-blend);
|
|
286
|
+
--uikit-symbol-scale: var(--uikit-button-content-scale, none);
|
|
287
|
+
|
|
288
|
+
position: relative;
|
|
289
|
+
display: inline-flex;
|
|
290
|
+
min-width: 0;
|
|
291
|
+
align-items: center;
|
|
292
|
+
justify-content: center;
|
|
293
|
+
gap: inherit;
|
|
294
|
+
mix-blend-mode: var(--uikit-symbol-blend);
|
|
295
|
+
scale: var(--uikit-symbol-scale);
|
|
296
|
+
transition-duration: var(--glass-ios-lens-duration);
|
|
297
|
+
transition-property: scale;
|
|
298
|
+
|
|
299
|
+
&:has(.uikit-symbol) {
|
|
300
|
+
mix-blend-mode: normal;
|
|
301
|
+
scale: none;
|
|
302
|
+
|
|
303
|
+
& > :not(:has(.uikit-symbol)) {
|
|
304
|
+
mix-blend-mode: var(--uikit-symbol-blend);
|
|
305
|
+
scale: var(--uikit-symbol-scale);
|
|
306
|
+
transition: scale var(--glass-ios-lens-duration);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.uikit-button-icon {
|
|
312
|
+
display: inline-flex;
|
|
313
|
+
min-height: 1lh;
|
|
314
|
+
align-items: center;
|
|
315
|
+
justify-content: center;
|
|
316
|
+
font-size: var(--uikit-button-icon-font-size);
|
|
317
|
+
font-variation-settings: 'wght' var(--uikit-button-icon-font-weight);
|
|
318
|
+
font-weight: round(down, var(--uikit-button-icon-font-weight), 100);
|
|
319
|
+
line-height: var(--uikit-button-icon-line-height);
|
|
320
|
+
stroke: currentcolor;
|
|
321
|
+
stroke-linejoin: round;
|
|
322
|
+
stroke-width: max(
|
|
323
|
+
0px,
|
|
324
|
+
(var(--uikit-button-icon-font-weight) - 400) / 326 * 1px
|
|
325
|
+
);
|
|
326
|
+
|
|
327
|
+
--uikit-symbol-thinning: max(
|
|
328
|
+
0px,
|
|
329
|
+
(400 - var(--uikit-button-icon-font-weight)) / 326 * 1px
|
|
330
|
+
);
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
.uikit-button-label {
|
|
334
|
+
overflow: hidden;
|
|
335
|
+
min-width: 0;
|
|
336
|
+
text-overflow: ellipsis;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import './style.css';
|
|
2
|
+
import { RadioGroup as BaseRadioGroup } from '@base-ui/react/radio-group';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
import type { CheckboxRootProps, RadioRootProps } from './props.js';
|
|
5
|
+
export type { CheckboxRootProps, RadioRootProps } from './props.js';
|
|
6
|
+
export declare const Check: () => ReactNode;
|
|
7
|
+
export declare const Checkbox: {
|
|
8
|
+
Root: import("preact").FunctionalComponent<import("react").PropsWithoutRef<CheckboxRootProps> & {
|
|
9
|
+
ref?: import("preact").Ref<HTMLElement> | undefined;
|
|
10
|
+
}>;
|
|
11
|
+
Indicator: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react/checkbox").CheckboxIndicatorProps, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
|
|
12
|
+
};
|
|
13
|
+
export declare const Radio: {
|
|
14
|
+
Root: import("preact").FunctionalComponent<import("react").PropsWithoutRef<RadioRootProps> & {
|
|
15
|
+
ref?: import("preact").Ref<HTMLElement> | undefined;
|
|
16
|
+
}>;
|
|
17
|
+
Indicator: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react/radio").RadioIndicatorProps, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
|
|
18
|
+
};
|
|
19
|
+
/** Base UI's: checkboxes sharing a value (an array), and a parent's. */
|
|
20
|
+
export declare const CheckboxGroup: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react/checkbox-group").CheckboxGroupProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
21
|
+
/** Base UI's: radios sharing a value. */
|
|
22
|
+
export declare const RadioGroup: <Value>(props: BaseRadioGroup.Props<Value>) => import("react").JSX.Element;
|
|
23
|
+
//# sourceMappingURL=main.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/components/checkbox/main.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AAKrB,OAAO,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EAAc,SAAS,EAAE,MAAM,OAAO,CAAC;AAG9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEpE,YAAY,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAgBpE,eAAO,MAAM,KAAK,QAAO,SAexB,CAAC;AAgEF,eAAO,MAAM,QAAQ;;;;;CAGpB,CAAC;AAEF,eAAO,MAAM,KAAK;;;;;CAGjB,CAAC;AAEF,wEAAwE;AACxE,eAAO,MAAM,aAAa,oKAAoB,CAAC;AAE/C,yCAAyC;AACzC,eAAO,MAAM,UAAU,4EAAiB,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import './style.css';
|
|
3
|
+
import { Checkbox as BaseCheckbox } from '@base-ui/react/checkbox';
|
|
4
|
+
import { CheckboxGroup as BaseCheckboxGroup } from '@base-ui/react/checkbox-group';
|
|
5
|
+
import { Radio as BaseRadio } from '@base-ui/react/radio';
|
|
6
|
+
import { RadioGroup as BaseRadioGroup } from '@base-ui/react/radio-group';
|
|
7
|
+
import { forwardRef } from 'react';
|
|
8
|
+
import { cn } from '../utils/main.js';
|
|
9
|
+
// Source: Apple iOS 26 Figma (“_Edit Buttons”, State=Selected/Unselected):
|
|
10
|
+
// 22px circles, unselected with a 1.5px `systemGray3` border, selected in
|
|
11
|
+
// the tint with a white checkmark. iOS has no checkboxes or radio buttons
|
|
12
|
+
// of its own: lists select rows with these circles (UIKit editing), as
|
|
13
|
+
// Framework7's iOS checkboxes are (`checkbox-ios.less`); mixed
|
|
14
|
+
// (indeterminate), a dash (Framework7). Base UI checkboxes and radios (a
|
|
15
|
+
// button, with a hidden input for forms), also used by `List` (`Checkbox`,
|
|
16
|
+
// `Radio`).
|
|
17
|
+
//
|
|
18
|
+
// Deviations:
|
|
19
|
+
// - Radios are circles too (Framework7 iOS: a checkmark only, as
|
|
20
|
+
// `List.Checkmark`).
|
|
21
|
+
// - The hit area is 44px (HIG), centered (Figma: the circle).
|
|
22
|
+
export const Check = () => (_jsx("svg", { "aria-hidden": "true", "data-glyph": "check", fill: "none", height: "1em", stroke: "currentcolor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", viewBox: "0 0 17 17", width: "1em", children: _jsx("path", { d: "M2 9l4.5 5L15.2 1.5" }) }));
|
|
23
|
+
const Dash = () => (_jsx("svg", { "aria-hidden": "true", "data-glyph": "dash", fill: "none", height: "1em", stroke: "currentcolor", strokeLinecap: "round", strokeWidth: "2", viewBox: "0 0 17 17", width: "1em", children: _jsx("path", { d: "M3.5 8.5h10" }) }));
|
|
24
|
+
/**
|
|
25
|
+
* A checkbox (Base UI): a selection circle, its checkmark (mixed: a dash)
|
|
26
|
+
* shown by `Indicator` unless given other children.
|
|
27
|
+
*/
|
|
28
|
+
const CheckboxRoot = forwardRef(({ className, children, ...props }, ref) => (_jsx(BaseCheckbox.Root, { ref: ref, ...props, "data-checkbox-part": "select-circle", className: cn('uikit-checkbox-select-circle uikit-checkbox-edit-circle', className), children: children ?? (_jsxs(BaseCheckbox.Indicator, { children: [_jsx(Check, {}), _jsx(Dash, {})] })) })));
|
|
29
|
+
/** A radio (Base UI), in a `RadioGroup`: a selection circle, as `Checkbox`. */
|
|
30
|
+
const RadioRoot = forwardRef(({ className, children, ...props }, ref) => (_jsx(BaseRadio.Root, { ref: ref, ...props, "data-checkbox-part": "select-circle", className: cn('uikit-checkbox-select-circle uikit-checkbox-edit-circle', className), children: children ?? (_jsx(BaseRadio.Indicator, { children: _jsx(Check, {}) })) })));
|
|
31
|
+
export const Checkbox = {
|
|
32
|
+
...BaseCheckbox,
|
|
33
|
+
Root: CheckboxRoot,
|
|
34
|
+
};
|
|
35
|
+
export const Radio = {
|
|
36
|
+
...BaseRadio,
|
|
37
|
+
Root: RadioRoot,
|
|
38
|
+
};
|
|
39
|
+
/** Base UI's: checkboxes sharing a value (an array), and a parent's. */
|
|
40
|
+
export const CheckboxGroup = BaseCheckboxGroup;
|
|
41
|
+
/** Base UI's: radios sharing a value. */
|
|
42
|
+
export const RadioGroup = BaseRadioGroup;
|
|
43
|
+
//# sourceMappingURL=main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../../src/components/checkbox/main.tsx"],"names":[],"mappings":";AAAA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,aAAa,IAAI,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACnF,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAa,MAAM,OAAO,CAAC;AAE9C,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAKtC,2EAA2E;AAC3E,0EAA0E;AAC1E,0EAA0E;AAC1E,uEAAuE;AACvE,+DAA+D;AAC/D,yEAAyE;AACzE,2EAA2E;AAC3E,YAAY;AACZ,EAAE;AACF,cAAc;AACd,iEAAiE;AACjE,uBAAuB;AACvB,8DAA8D;AAE9D,MAAM,CAAC,MAAM,KAAK,GAAG,GAAc,EAAE,CAAC,CACpC,6BACc,MAAM,gBACP,OAAO,EAClB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,KAAK,EACZ,MAAM,EAAC,cAAc,EACrB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,EACtB,WAAW,EAAC,GAAG,EACf,OAAO,EAAC,WAAW,EACnB,KAAK,EAAC,KAAK,YAEX,eAAM,CAAC,EAAC,qBAAqB,GAAG,GAC5B,CACP,CAAC;AAEF,MAAM,IAAI,GAAG,GAAG,EAAE,CAAC,CACjB,6BACc,MAAM,gBACP,MAAM,EACjB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,KAAK,EACZ,MAAM,EAAC,cAAc,EACrB,aAAa,EAAC,OAAO,EACrB,WAAW,EAAC,GAAG,EACf,OAAO,EAAC,WAAW,EACnB,KAAK,EAAC,KAAK,YAEX,eAAM,CAAC,EAAC,aAAa,GAAG,GACpB,CACP,CAAC;AAEF;;;GAGG;AACH,MAAM,YAAY,GAAG,UAAU,CAC7B,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAC1C,KAAC,YAAY,CAAC,IAAI,IAChB,GAAG,EAAE,GAAG,KACJ,KAAK,wBACU,eAAe,EAClC,SAAS,EAAE,EAAE,CACX,yDAAyD,EACzD,SAAS,CACV,YAEA,QAAQ,IAAI,CACX,MAAC,YAAY,CAAC,SAAS,eACrB,KAAC,KAAK,KAAG,EACT,KAAC,IAAI,KAAG,IACe,CAC1B,GACiB,CACrB,CACF,CAAC;AAEF,+EAA+E;AAC/E,MAAM,SAAS,GAAG,UAAU,CAC1B,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAC1C,KAAC,SAAS,CAAC,IAAI,IACb,GAAG,EAAE,GAAG,KACJ,KAAK,wBACU,eAAe,EAClC,SAAS,EAAE,EAAE,CACX,yDAAyD,EACzD,SAAS,CACV,YAEA,QAAQ,IAAI,CACX,KAAC,SAAS,CAAC,SAAS,cAClB,KAAC,KAAK,KAAG,GACW,CACvB,GACc,CAClB,CACF,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,GAAG,YAAY;IACf,IAAI,EAAE,YAAY;CACnB,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,GAAG,SAAS;IACZ,IAAI,EAAE,SAAS;CAChB,CAAC;AAEF,wEAAwE;AACxE,MAAM,CAAC,MAAM,aAAa,GAAG,iBAAiB,CAAC;AAE/C,yCAAyC;AACzC,MAAM,CAAC,MAAM,UAAU,GAAG,cAAc,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Checkbox as BaseCheckbox } from '@base-ui/react/checkbox';
|
|
2
|
+
import type { Radio as BaseRadio } from '@base-ui/react/radio';
|
|
3
|
+
import type { Properties } from 'csstype';
|
|
4
|
+
export type CursorProps = {
|
|
5
|
+
/**
|
|
6
|
+
* As `Button`: the cursor.
|
|
7
|
+
* @default 'pointer' (disabled: 'not-allowed')
|
|
8
|
+
*/
|
|
9
|
+
cursor?: Properties['cursor'];
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export type CheckboxRootProps = Omit<BaseCheckbox.Root.Props, 'ref'> & CursorProps;
|
|
13
|
+
export type RadioRootProps = Omit<BaseRadio.Root.Props, 'ref'> & CursorProps;
|
|
14
|
+
//# sourceMappingURL=props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/components/checkbox/props.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,KAAK,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,MAAM,MAAM,WAAW,GAAG;IACxB;;;OAGG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,GAClE,WAAW,CAAC;AAEd,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.js","sourceRoot":"","sources":["../../../src/components/checkbox/props.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/* Checkbox (see main.tsx). */
|
|
2
|
+
@layer uikit-ish {
|
|
3
|
+
/* (Shared: list.) */
|
|
4
|
+
.uikit-checkbox-edit-circle {
|
|
5
|
+
display: grid;
|
|
6
|
+
width: 22px;
|
|
7
|
+
height: 22px;
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
border-radius: 50%;
|
|
10
|
+
color: #fff;
|
|
11
|
+
font-size: 14.5px;
|
|
12
|
+
font-variation-settings: 'wght' 590;
|
|
13
|
+
font-weight: round(down, 590, 100);
|
|
14
|
+
place-items: center;
|
|
15
|
+
stroke: currentcolor;
|
|
16
|
+
stroke-linejoin: round;
|
|
17
|
+
stroke-width: max(0px, (590 - 400) / 326 * 1px);
|
|
18
|
+
|
|
19
|
+
--uikit-symbol-thinning: max(0px, (400 - 590) / 326 * 1px);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/* Figma State=Selected/Unselected (mixed: as selected). */
|
|
23
|
+
.uikit-checkbox-select-circle {
|
|
24
|
+
position: relative;
|
|
25
|
+
flex: none;
|
|
26
|
+
padding: 0;
|
|
27
|
+
border: 1.5px solid
|
|
28
|
+
var(--uikit-checkbox-select-circle-border, var(--color-ios-system-gray3));
|
|
29
|
+
margin: 0;
|
|
30
|
+
appearance: none;
|
|
31
|
+
background: none;
|
|
32
|
+
outline-offset: 2px;
|
|
33
|
+
|
|
34
|
+
--uikit-utils-cursor: attr(cursor type(<custom-ident>), pointer);
|
|
35
|
+
|
|
36
|
+
@media (hover: hover) {
|
|
37
|
+
cursor: var(--uikit-utils-cursor);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* Hit region: 44×44px, centered. */
|
|
41
|
+
&::after {
|
|
42
|
+
position: absolute;
|
|
43
|
+
content: '';
|
|
44
|
+
inset: -12.5px;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&[data-checked],
|
|
48
|
+
&[data-indeterminate] {
|
|
49
|
+
border-color: transparent;
|
|
50
|
+
background-color: var(--color-ios-primary);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&[data-disabled] {
|
|
54
|
+
--uikit-utils-cursor: attr(cursor type(<custom-ident>), not-allowed);
|
|
55
|
+
|
|
56
|
+
opacity: 0.5;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/* The glyph (checked: the checkmark, mixed: the dash). */
|
|
60
|
+
& > * {
|
|
61
|
+
display: contents;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
& [data-glyph='dash'],
|
|
65
|
+
&[data-indeterminate] [data-glyph='check'] {
|
|
66
|
+
display: none;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&[data-indeterminate] [data-glyph='dash'] {
|
|
70
|
+
display: block;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import '../button/style.css';
|
|
2
|
+
import '../menu/style.css';
|
|
3
|
+
import '../page-control/style.css';
|
|
4
|
+
import '../segmented/style.css';
|
|
5
|
+
import '../slider/style.css';
|
|
6
|
+
import './style.css';
|
|
7
|
+
import { FunctionComponent } from 'react';
|
|
8
|
+
import type { ColorPickerEyedropperProps, ColorPickerPanelProps, ColorPickerRootProps, ColorWellProps, Rgba } from './props.js';
|
|
9
|
+
export type { ColorPickerEyedropperProps, ColorPickerMode, ColorPickerPanelProps, ColorPickerRootProps, ColorWellProps, } from './props.js';
|
|
10
|
+
/** A hex color (#rgb, #rrggbb, #rrggbbaa) as channels (0–255, alpha 0–1). */
|
|
11
|
+
export declare const parseColor: (hex: string) => Rgba;
|
|
12
|
+
/** Channels as a hex color (#rrggbb, or #rrggbbaa if not opaque). */
|
|
13
|
+
export declare const formatColor: ({ a, b, g, r }: Rgba) => string;
|
|
14
|
+
/** Figma's saved colors. */
|
|
15
|
+
export declare const defaultSavedColors: string[];
|
|
16
|
+
export declare const ColorPicker: {
|
|
17
|
+
Root: import("preact").FunctionalComponent<import("react").PropsWithoutRef<ColorPickerRootProps> & {
|
|
18
|
+
ref?: import("preact").Ref<HTMLDivElement> | undefined;
|
|
19
|
+
}>;
|
|
20
|
+
Header: import("preact").FunctionalComponent<import("react").PropsWithoutRef<import("preact").HTMLAttributes<HTMLDivElement>> & {
|
|
21
|
+
ref?: import("preact").Ref<HTMLDivElement> | undefined;
|
|
22
|
+
}>;
|
|
23
|
+
Panel: import("preact").FunctionalComponent<import("react").PropsWithoutRef<ColorPickerPanelProps> & {
|
|
24
|
+
ref?: import("preact").Ref<HTMLDivElement> | undefined;
|
|
25
|
+
}>;
|
|
26
|
+
Eyedropper: FunctionComponent<ColorPickerEyedropperProps>;
|
|
27
|
+
Well: import("preact").FunctionalComponent<import("react").PropsWithoutRef<ColorWellProps> & {
|
|
28
|
+
ref?: import("preact").Ref<HTMLButtonElement> | undefined;
|
|
29
|
+
}>;
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=main.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/components/color-picker/main.tsx"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAC7B,OAAO,mBAAmB,CAAC;AAC3B,OAAO,2BAA2B,CAAC;AACnC,OAAO,wBAAwB,CAAC;AAChC,OAAO,qBAAqB,CAAC;AAC7B,OAAO,aAAa,CAAC;AAGrB,OAAO,EAKL,iBAAiB,EASlB,MAAM,OAAO,CAAC;AAQf,OAAO,KAAK,EACV,0BAA0B,EAE1B,qBAAqB,EACrB,oBAAoB,EACpB,cAAc,EAGd,IAAI,EACL,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,0BAA0B,EAC1B,eAAe,EACf,qBAAqB,EACrB,oBAAoB,EACpB,cAAc,GACf,MAAM,YAAY,CAAC;AAiCpB,6EAA6E;AAC7E,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM,KAAG,IAexC,CAAC;AAOF,qEAAqE;AACrE,eAAO,MAAM,WAAW,GAAI,gBAAgB,IAAI,KAAG,MAC+B,CAAC;AA0CnF,4BAA4B;AAC5B,eAAO,MAAM,kBAAkB,UAU9B,CAAC;AAukBF,eAAO,MAAM,WAAW;;;;;;;;;;;;;;CAMvB,CAAC"}
|