@jackbernnie/hiyf 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +191 -0
- package/NOTICE +12 -0
- package/README.md +47 -0
- package/dist/components/Accordion.d.ts +38 -0
- package/dist/components/Accordion.js +38 -0
- package/dist/components/Alert.d.ts +29 -0
- package/dist/components/Alert.js +39 -0
- package/dist/components/AlertDialog.d.ts +37 -0
- package/dist/components/AlertDialog.js +38 -0
- package/dist/components/AspectRatio.d.ts +15 -0
- package/dist/components/AspectRatio.js +15 -0
- package/dist/components/Avatar.d.ts +26 -0
- package/dist/components/Avatar.js +13 -0
- package/dist/components/Badge.d.ts +18 -0
- package/dist/components/Badge.js +17 -0
- package/dist/components/Box.d.ts +13 -0
- package/dist/components/Box.js +52 -0
- package/dist/components/Breadcrumb.d.ts +33 -0
- package/dist/components/Breadcrumb.js +16 -0
- package/dist/components/Button.d.ts +40 -0
- package/dist/components/Button.js +33 -0
- package/dist/components/ButtonGroup.d.ts +18 -0
- package/dist/components/ButtonGroup.js +8 -0
- package/dist/components/Card.d.ts +46 -0
- package/dist/components/Card.js +24 -0
- package/dist/components/Carousel.d.ts +27 -0
- package/dist/components/Carousel.js +13 -0
- package/dist/components/Chart.d.ts +17 -0
- package/dist/components/Chart.js +94 -0
- package/dist/components/Checkbox.d.ts +26 -0
- package/dist/components/Checkbox.js +9 -0
- package/dist/components/Collapsible.d.ts +27 -0
- package/dist/components/Collapsible.js +26 -0
- package/dist/components/Combobox.d.ts +36 -0
- package/dist/components/Combobox.js +41 -0
- package/dist/components/Command.d.ts +37 -0
- package/dist/components/Command.js +32 -0
- package/dist/components/ContextMenu.d.ts +34 -0
- package/dist/components/ContextMenu.js +23 -0
- package/dist/components/Dialog.d.ts +20 -0
- package/dist/components/Dialog.js +34 -0
- package/dist/components/Drawer.d.ts +28 -0
- package/dist/components/Drawer.js +25 -0
- package/dist/components/DropdownMenu.d.ts +42 -0
- package/dist/components/DropdownMenu.js +32 -0
- package/dist/components/Empty.d.ts +28 -0
- package/dist/components/Empty.js +15 -0
- package/dist/components/Field.d.ts +30 -0
- package/dist/components/Field.js +13 -0
- package/dist/components/Grid.d.ts +32 -0
- package/dist/components/Grid.js +37 -0
- package/dist/components/GridItem.d.ts +30 -0
- package/dist/components/GridItem.js +40 -0
- package/dist/components/HoverCard.d.ts +22 -0
- package/dist/components/HoverCard.js +12 -0
- package/dist/components/Input.d.ts +34 -0
- package/dist/components/Input.js +8 -0
- package/dist/components/InputGroup.d.ts +28 -0
- package/dist/components/InputGroup.js +13 -0
- package/dist/components/InputOTP.d.ts +26 -0
- package/dist/components/InputOTP.js +25 -0
- package/dist/components/Kbd.d.ts +26 -0
- package/dist/components/Kbd.js +11 -0
- package/dist/components/Label.d.ts +20 -0
- package/dist/components/Label.js +17 -0
- package/dist/components/Menubar.d.ts +35 -0
- package/dist/components/Menubar.js +19 -0
- package/dist/components/NativeSelect.d.ts +33 -0
- package/dist/components/NativeSelect.js +37 -0
- package/dist/components/NavigationMenu.d.ts +32 -0
- package/dist/components/NavigationMenu.js +14 -0
- package/dist/components/Pagination.d.ts +28 -0
- package/dist/components/Pagination.js +62 -0
- package/dist/components/Popover.d.ts +28 -0
- package/dist/components/Popover.js +19 -0
- package/dist/components/Progress.d.ts +25 -0
- package/dist/components/Progress.js +37 -0
- package/dist/components/RadioGroup.d.ts +35 -0
- package/dist/components/RadioGroup.js +44 -0
- package/dist/components/Resizable.d.ts +31 -0
- package/dist/components/Resizable.js +17 -0
- package/dist/components/ScrollArea.d.ts +8 -0
- package/dist/components/ScrollArea.js +14 -0
- package/dist/components/Select.d.ts +35 -0
- package/dist/components/Select.js +33 -0
- package/dist/components/Separator.d.ts +10 -0
- package/dist/components/Separator.js +30 -0
- package/dist/components/Sheet.d.ts +31 -0
- package/dist/components/Sheet.js +26 -0
- package/dist/components/Sidebar.d.ts +52 -0
- package/dist/components/Sidebar.js +96 -0
- package/dist/components/Skeleton.d.ts +40 -0
- package/dist/components/Skeleton.js +42 -0
- package/dist/components/Slider.d.ts +26 -0
- package/dist/components/Slider.js +9 -0
- package/dist/components/Spinner.d.ts +7 -0
- package/dist/components/Spinner.js +13 -0
- package/dist/components/Status.d.ts +30 -0
- package/dist/components/Status.js +27 -0
- package/dist/components/Switch.d.ts +27 -0
- package/dist/components/Switch.js +9 -0
- package/dist/components/Table.d.ts +39 -0
- package/dist/components/Table.js +22 -0
- package/dist/components/Tabs.d.ts +32 -0
- package/dist/components/Tabs.js +21 -0
- package/dist/components/Text.d.ts +2 -0
- package/dist/components/Text.js +5 -0
- package/dist/components/Textarea.d.ts +32 -0
- package/dist/components/Textarea.js +15 -0
- package/dist/components/Toaster.d.ts +30 -0
- package/dist/components/Toaster.js +9 -0
- package/dist/components/Toggle.d.ts +34 -0
- package/dist/components/Toggle.js +31 -0
- package/dist/components/ToggleGroup.d.ts +46 -0
- package/dist/components/ToggleGroup.js +26 -0
- package/dist/components/Tooltip.d.ts +25 -0
- package/dist/components/Tooltip.js +12 -0
- package/dist/components/ui/accordion.d.ts +7 -0
- package/dist/components/ui/accordion.js +81 -0
- package/dist/components/ui/alert-dialog.d.ts +18 -0
- package/dist/components/ui/alert-dialog.js +154 -0
- package/dist/components/ui/alert.d.ts +10 -0
- package/dist/components/ui/alert.js +64 -0
- package/dist/components/ui/aspect-ratio.d.ts +3 -0
- package/dist/components/ui/aspect-ratio.js +11 -0
- package/dist/components/ui/avatar.d.ts +11 -0
- package/dist/components/ui/avatar.js +57 -0
- package/dist/components/ui/badge.d.ts +9 -0
- package/dist/components/ui/badge.js +42 -0
- package/dist/components/ui/breadcrumb.d.ts +11 -0
- package/dist/components/ui/breadcrumb.js +87 -0
- package/dist/components/ui/button-group.d.ts +11 -0
- package/dist/components/ui/button-group.js +37 -0
- package/dist/components/ui/button.d.ts +10 -0
- package/dist/components/ui/button.js +55 -0
- package/dist/components/ui/card.d.ts +11 -0
- package/dist/components/ui/card.js +82 -0
- package/dist/components/ui/carousel.d.ts +28 -0
- package/dist/components/ui/carousel.js +196 -0
- package/dist/components/ui/chart.d.ts +44 -0
- package/dist/components/ui/chart.js +198 -0
- package/dist/components/ui/checkbox.d.ts +4 -0
- package/dist/components/ui/checkbox.js +33 -0
- package/dist/components/ui/collapsible.d.ts +5 -0
- package/dist/components/ui/collapsible.js +33 -0
- package/dist/components/ui/combobox.d.ts +24 -0
- package/dist/components/ui/combobox.js +160 -0
- package/dist/components/ui/command.d.ts +18 -0
- package/dist/components/ui/command.js +142 -0
- package/dist/components/ui/context-menu.d.ts +31 -0
- package/dist/components/ui/context-menu.js +73 -0
- package/dist/components/ui/dialog.d.ts +17 -0
- package/dist/components/ui/dialog.js +138 -0
- package/dist/components/ui/direction.d.ts +7 -0
- package/dist/components/ui/direction.js +14 -0
- package/dist/components/ui/drawer.d.ts +13 -0
- package/dist/components/ui/drawer.js +101 -0
- package/dist/components/ui/dropdown-menu.d.ts +29 -0
- package/dist/components/ui/dropdown-menu.js +98 -0
- package/dist/components/ui/empty.d.ts +11 -0
- package/dist/components/ui/empty.js +97 -0
- package/dist/components/ui/field.d.ts +24 -0
- package/dist/components/ui/field.js +110 -0
- package/dist/components/ui/hover-card.d.ts +6 -0
- package/dist/components/ui/hover-card.js +37 -0
- package/dist/components/ui/input-group.d.ts +16 -0
- package/dist/components/ui/input-group.js +111 -0
- package/dist/components/ui/input-otp.d.ts +11 -0
- package/dist/components/ui/input-otp.js +66 -0
- package/dist/components/ui/input.d.ts +3 -0
- package/dist/components/ui/input.js +19 -0
- package/dist/components/ui/item.d.ts +23 -0
- package/dist/components/ui/item.js +181 -0
- package/dist/components/ui/kbd.d.ts +3 -0
- package/dist/components/ui/kbd.js +28 -0
- package/dist/components/ui/label.d.ts +4 -0
- package/dist/components/ui/label.js +23 -0
- package/dist/components/ui/menubar.d.ts +30 -0
- package/dist/components/ui/menubar.js +119 -0
- package/dist/components/ui/native-select.d.ts +8 -0
- package/dist/components/ui/native-select.js +49 -0
- package/dist/components/ui/navigation-menu.d.ts +14 -0
- package/dist/components/ui/navigation-menu.js +139 -0
- package/dist/components/ui/pagination.d.ts +17 -0
- package/dist/components/ui/pagination.js +120 -0
- package/dist/components/ui/popover.d.ts +10 -0
- package/dist/components/ui/popover.js +37 -0
- package/dist/components/ui/progress.d.ts +4 -0
- package/dist/components/ui/radio-group.d.ts +5 -0
- package/dist/components/ui/radio-group.js +44 -0
- package/dist/components/ui/resizable.d.ts +7 -0
- package/dist/components/ui/resizable.js +44 -0
- package/dist/components/ui/scroll-area.d.ts +5 -0
- package/dist/components/ui/scroll-area.js +59 -0
- package/dist/components/ui/select.d.ts +15 -0
- package/dist/components/ui/select.js +131 -0
- package/dist/components/ui/separator.d.ts +4 -0
- package/dist/components/ui/separator.js +27 -0
- package/dist/components/ui/sheet.d.ts +14 -0
- package/dist/components/ui/sheet.js +113 -0
- package/dist/components/ui/sidebar.d.ts +69 -0
- package/dist/components/ui/sidebar.js +459 -0
- package/dist/components/ui/skeleton.d.ts +2 -0
- package/dist/components/ui/slider.d.ts +4 -0
- package/dist/components/ui/slider.js +60 -0
- package/dist/components/ui/sonner.d.ts +3 -0
- package/dist/components/ui/sonner.js +38 -0
- package/dist/components/ui/spinner.d.ts +2 -0
- package/dist/components/ui/spinner.js +13 -0
- package/dist/components/ui/switch.d.ts +6 -0
- package/dist/components/ui/switch.js +32 -0
- package/dist/components/ui/table.d.ts +10 -0
- package/dist/components/ui/table.js +95 -0
- package/dist/components/ui/tabs.d.ts +11 -0
- package/dist/components/ui/tabs.js +87 -0
- package/dist/components/ui/textarea.d.ts +3 -0
- package/dist/components/ui/textarea.js +18 -0
- package/dist/components/ui/toggle-group.d.ts +10 -0
- package/dist/components/ui/toggle-group.js +76 -0
- package/dist/components/ui/toggle.d.ts +9 -0
- package/dist/components/ui/toggle.js +43 -0
- package/dist/components/ui/tooltip.d.ts +7 -0
- package/dist/components/ui/tooltip.js +53 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-mobile.js +18 -0
- package/dist/index.d.ts +122 -0
- package/dist/index.js +61 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +8 -0
- package/dist/primitives/createText.d.ts +103 -0
- package/dist/primitives/createText.js +183 -0
- package/dist/primitives/resolveProperties.d.ts +17 -0
- package/dist/stylex.css +1450 -0
- package/dist/tokens/animations.d.ts +126 -0
- package/dist/tokens/animations.js +61 -0
- package/dist/tokens/tokens.stylex.d.ts +85 -0
- package/dist/tokens/tokens.stylex.js +81 -0
- package/dist/utils/box-styles.d.ts +1117 -0
- package/dist/utils/box-styles.js +1455 -0
- package/dist/utils/grid.d.ts +4 -0
- package/dist/utils/resolvers.d.ts +10 -0
- package/dist/utils/resolvers.js +356 -0
- package/dist/utils/types.d.ts +133 -0
- package/package.json +80 -0
- package/src/theme.css +206 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** A single grid line: a (possibly negative) line number, `auto`, or a span. */
|
|
2
|
+
export type GridLine = number | 'auto' | `span ${number}`;
|
|
3
|
+
/** A `grid-column` / `grid-row` value: a single line, or `<start> / <end>`. */
|
|
4
|
+
export type GridPlacement = GridLine | `${GridLine} / ${GridLine}`;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as stylex from '@stylexjs/stylex';
|
|
2
|
+
import type React from 'react';
|
|
3
|
+
import type { BoxStyleProps } from './types';
|
|
4
|
+
export declare const BOX_STYLE_PROP_KEYS: Set<string>;
|
|
5
|
+
export interface ResolvedStyles {
|
|
6
|
+
stylexStyles: stylex.StyleXStyles[];
|
|
7
|
+
inlineStyle: React.CSSProperties;
|
|
8
|
+
responsiveCSS: string | null;
|
|
9
|
+
}
|
|
10
|
+
export declare function resolveBoxStyles(props: BoxStyleProps, scopeClass: string): ResolvedStyles;
|
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
import { breakpoints, spacing, backgroundColors, textColors, borderColors, borderRadii, shadows, durations, easings } from '../tokens/tokens.stylex.js';
|
|
2
|
+
import { marginBottomStyles, marginLeftStyles, marginInlineStyles, marginBlockStyles, gapStyles, rowGapStyles, columnGapStyles, backgroundColorStyles, colorStyles, borderColorStyles, borderRadiusStyles, borderTopLeftRadiusStyles, borderTopRightRadiusStyles, borderBottomLeftRadiusStyles, borderBottomRightRadiusStyles, borderStyleStyles, boxShadowStyles, displayStyles, overflowStyles, overflowXStyles, overflowYStyles, flexDirectionStyles, flexWrapStyles, alignItemsStyles, alignSelfStyles, justifyContentStyles, alignContentStyles, gridAutoFlowStyles, positionStyles, transitionPropertyStyles, transitionDurationStyles, transitionTimingFunctionStyles, transitionDelayStyles, cursorStyles, pointerEventsStyles, visibilityStyles, userSelectStyles, textAlignStyles, paddingStyles, paddingTopStyles, paddingRightStyles, paddingBottomStyles, paddingLeftStyles, paddingInlineStyles, paddingBlockStyles, marginStyles, marginTopStyles, marginRightStyles, TRANSITION_PROPERTY_VALUES } from './box-styles.js';
|
|
3
|
+
|
|
4
|
+
const PSEUDO_SELECTOR_MAP = {
|
|
5
|
+
hover: ":hover",
|
|
6
|
+
focus: ":focus",
|
|
7
|
+
active: ":active",
|
|
8
|
+
focusVisible: ":focus-visible",
|
|
9
|
+
focusWithin: ":focus-within"
|
|
10
|
+
};
|
|
11
|
+
function isPseudoState(key) {
|
|
12
|
+
return key in PSEUDO_SELECTOR_MAP;
|
|
13
|
+
}
|
|
14
|
+
function isResponsive(value) {
|
|
15
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
16
|
+
}
|
|
17
|
+
function toKebab(str) {
|
|
18
|
+
return str.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`);
|
|
19
|
+
}
|
|
20
|
+
const DECLARATION_ORDER = ["padding", "margin", "gap", "padding-inline", "margin-inline", "padding-block", "margin-block", "row-gap", "column-gap", "padding-top", "padding-right", "padding-bottom", "padding-left", "margin-top", "margin-right", "margin-bottom", "margin-left", "border-width", "border-style", "border-color", "border-radius", "border-top-left-radius", "border-top-right-radius", "border-bottom-left-radius", "border-bottom-right-radius", "border-top-width", "border-right-width", "border-bottom-width", "border-left-width", "overflow", "overflow-x", "overflow-y", "flex", "flex-direction", "flex-wrap", "flex-grow", "flex-shrink", "flex-basis", "inset", "top", "right", "bottom", "left"];
|
|
21
|
+
function normalizedCssKey(key) {
|
|
22
|
+
return key.includes("-") ? key : toKebab(key);
|
|
23
|
+
}
|
|
24
|
+
function sortedDeclarationEntries(record) {
|
|
25
|
+
return Object.entries(record).sort(([a], [b]) => {
|
|
26
|
+
const ka = normalizedCssKey(a);
|
|
27
|
+
const kb = normalizedCssKey(b);
|
|
28
|
+
const ia = DECLARATION_ORDER.indexOf(ka);
|
|
29
|
+
const ib = DECLARATION_ORDER.indexOf(kb);
|
|
30
|
+
const pa = ia === -1 ? 1e4 : ia;
|
|
31
|
+
const pb = ib === -1 ? 1e4 : ib;
|
|
32
|
+
if (pa !== pb) return pa - pb;
|
|
33
|
+
return ka.localeCompare(kb);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function px(v) {
|
|
37
|
+
return v === 0 ? "0" : `${v}px`;
|
|
38
|
+
}
|
|
39
|
+
function sizeValue(v) {
|
|
40
|
+
return typeof v === "number" ? px(v) : v;
|
|
41
|
+
}
|
|
42
|
+
function spacingCss(token) {
|
|
43
|
+
return spacing[token];
|
|
44
|
+
}
|
|
45
|
+
function marginCss(token) {
|
|
46
|
+
if (token === "auto") return "auto";
|
|
47
|
+
return spacing[token];
|
|
48
|
+
}
|
|
49
|
+
function backgroundColorCss(token) {
|
|
50
|
+
return backgroundColors[token];
|
|
51
|
+
}
|
|
52
|
+
function textColorCss(token) {
|
|
53
|
+
return textColors[token];
|
|
54
|
+
}
|
|
55
|
+
function borderColorCss(token) {
|
|
56
|
+
return borderColors[token];
|
|
57
|
+
}
|
|
58
|
+
function radiusCss(token) {
|
|
59
|
+
return borderRadii[token];
|
|
60
|
+
}
|
|
61
|
+
function shadowCss(token) {
|
|
62
|
+
return shadows[token];
|
|
63
|
+
}
|
|
64
|
+
function durationCss(token) {
|
|
65
|
+
return durations[token];
|
|
66
|
+
}
|
|
67
|
+
function easingCss(token) {
|
|
68
|
+
return easings[token];
|
|
69
|
+
}
|
|
70
|
+
function transitionPropertyCss(value) {
|
|
71
|
+
return TRANSITION_PROPERTY_VALUES[value];
|
|
72
|
+
}
|
|
73
|
+
const FLEX_KEYWORD_MAP = {
|
|
74
|
+
start: "flex-start",
|
|
75
|
+
end: "flex-end",
|
|
76
|
+
between: "space-between",
|
|
77
|
+
around: "space-around",
|
|
78
|
+
evenly: "space-evenly"
|
|
79
|
+
};
|
|
80
|
+
function flexKeyword(v) {
|
|
81
|
+
return FLEX_KEYWORD_MAP[v] ?? v;
|
|
82
|
+
}
|
|
83
|
+
const BOX_STYLE_PROP_MAP = {
|
|
84
|
+
padding: true,
|
|
85
|
+
paddingTop: true,
|
|
86
|
+
paddingRight: true,
|
|
87
|
+
paddingBottom: true,
|
|
88
|
+
paddingLeft: true,
|
|
89
|
+
paddingHorizontal: true,
|
|
90
|
+
paddingVertical: true,
|
|
91
|
+
p: true,
|
|
92
|
+
pt: true,
|
|
93
|
+
pr: true,
|
|
94
|
+
pb: true,
|
|
95
|
+
pl: true,
|
|
96
|
+
px: true,
|
|
97
|
+
py: true,
|
|
98
|
+
margin: true,
|
|
99
|
+
marginTop: true,
|
|
100
|
+
marginRight: true,
|
|
101
|
+
marginBottom: true,
|
|
102
|
+
marginLeft: true,
|
|
103
|
+
marginHorizontal: true,
|
|
104
|
+
marginVertical: true,
|
|
105
|
+
m: true,
|
|
106
|
+
mt: true,
|
|
107
|
+
mr: true,
|
|
108
|
+
mb: true,
|
|
109
|
+
ml: true,
|
|
110
|
+
mx: true,
|
|
111
|
+
my: true,
|
|
112
|
+
gap: true,
|
|
113
|
+
rowGap: true,
|
|
114
|
+
columnGap: true,
|
|
115
|
+
g: true,
|
|
116
|
+
backgroundColor: true,
|
|
117
|
+
color: true,
|
|
118
|
+
borderColor: true,
|
|
119
|
+
borderRadius: true,
|
|
120
|
+
borderTopLeftRadius: true,
|
|
121
|
+
borderTopRightRadius: true,
|
|
122
|
+
borderBottomLeftRadius: true,
|
|
123
|
+
borderBottomRightRadius: true,
|
|
124
|
+
borderWidth: true,
|
|
125
|
+
borderTopWidth: true,
|
|
126
|
+
borderRightWidth: true,
|
|
127
|
+
borderBottomWidth: true,
|
|
128
|
+
borderLeftWidth: true,
|
|
129
|
+
borderStyle: true,
|
|
130
|
+
boxShadow: true,
|
|
131
|
+
display: true,
|
|
132
|
+
overflow: true,
|
|
133
|
+
overflowX: true,
|
|
134
|
+
overflowY: true,
|
|
135
|
+
width: true,
|
|
136
|
+
height: true,
|
|
137
|
+
minWidth: true,
|
|
138
|
+
maxWidth: true,
|
|
139
|
+
minHeight: true,
|
|
140
|
+
maxHeight: true,
|
|
141
|
+
aspectRatio: true,
|
|
142
|
+
flex: true,
|
|
143
|
+
flexDirection: true,
|
|
144
|
+
flexWrap: true,
|
|
145
|
+
flexGrow: true,
|
|
146
|
+
flexShrink: true,
|
|
147
|
+
flexBasis: true,
|
|
148
|
+
alignItems: true,
|
|
149
|
+
alignSelf: true,
|
|
150
|
+
justifyContent: true,
|
|
151
|
+
alignContent: true,
|
|
152
|
+
gridTemplateColumns: true,
|
|
153
|
+
gridTemplateRows: true,
|
|
154
|
+
gridTemplateAreas: true,
|
|
155
|
+
gridColumn: true,
|
|
156
|
+
gridRow: true,
|
|
157
|
+
gridArea: true,
|
|
158
|
+
gridColumnStart: true,
|
|
159
|
+
gridColumnEnd: true,
|
|
160
|
+
gridRowStart: true,
|
|
161
|
+
gridRowEnd: true,
|
|
162
|
+
gridAutoFlow: true,
|
|
163
|
+
gridAutoColumns: true,
|
|
164
|
+
gridAutoRows: true,
|
|
165
|
+
position: true,
|
|
166
|
+
top: true,
|
|
167
|
+
right: true,
|
|
168
|
+
bottom: true,
|
|
169
|
+
left: true,
|
|
170
|
+
inset: true,
|
|
171
|
+
zIndex: true,
|
|
172
|
+
transitionProperty: true,
|
|
173
|
+
transitionDuration: true,
|
|
174
|
+
transitionTimingFunction: true,
|
|
175
|
+
ease: true,
|
|
176
|
+
transitionDelay: true,
|
|
177
|
+
transform: true,
|
|
178
|
+
transformOrigin: true,
|
|
179
|
+
willChange: true,
|
|
180
|
+
opacity: true,
|
|
181
|
+
cursor: true,
|
|
182
|
+
pointerEvents: true,
|
|
183
|
+
visibility: true,
|
|
184
|
+
userSelect: true,
|
|
185
|
+
textAlign: true
|
|
186
|
+
};
|
|
187
|
+
const BOX_STYLE_PROP_KEYS = new Set(Object.keys(BOX_STYLE_PROP_MAP));
|
|
188
|
+
function resolveBoxStyles(props, scopeClass) {
|
|
189
|
+
const sxStyles = [];
|
|
190
|
+
const inlineStyle = {};
|
|
191
|
+
const breakpointStyles = {};
|
|
192
|
+
const pseudoStyles = {};
|
|
193
|
+
function addTokenProp(styleMap, cssProp, value, transform) {
|
|
194
|
+
if (value === void 0) return;
|
|
195
|
+
if (isResponsive(value)) {
|
|
196
|
+
for (const [bp, v] of Object.entries(value)) {
|
|
197
|
+
if (v === void 0) continue;
|
|
198
|
+
if (bp === "base") {
|
|
199
|
+
const style = styleMap[v];
|
|
200
|
+
if (style) sxStyles.push(style);
|
|
201
|
+
} else if (isPseudoState(bp)) {
|
|
202
|
+
const selector = PSEUDO_SELECTOR_MAP[bp];
|
|
203
|
+
if (!pseudoStyles[selector]) pseudoStyles[selector] = {};
|
|
204
|
+
pseudoStyles[selector][cssProp] = transform(v);
|
|
205
|
+
} else {
|
|
206
|
+
const bpPx = breakpoints[bp];
|
|
207
|
+
if (bpPx !== void 0) {
|
|
208
|
+
if (!breakpointStyles[bpPx]) breakpointStyles[bpPx] = {};
|
|
209
|
+
breakpointStyles[bpPx][cssProp] = transform(v);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
} else {
|
|
214
|
+
const style = styleMap[value];
|
|
215
|
+
if (style) sxStyles.push(style);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
function addArbitraryProp(cssProp, value, transform) {
|
|
219
|
+
if (value === void 0) return;
|
|
220
|
+
if (isResponsive(value)) {
|
|
221
|
+
for (const [bp, v] of Object.entries(value)) {
|
|
222
|
+
if (v === void 0) continue;
|
|
223
|
+
const cssValue = transform(v);
|
|
224
|
+
if (bp === "base") {
|
|
225
|
+
if (!breakpointStyles[0]) breakpointStyles[0] = {};
|
|
226
|
+
breakpointStyles[0][cssProp] = cssValue;
|
|
227
|
+
} else if (isPseudoState(bp)) {
|
|
228
|
+
const selector = PSEUDO_SELECTOR_MAP[bp];
|
|
229
|
+
if (!pseudoStyles[selector]) pseudoStyles[selector] = {};
|
|
230
|
+
pseudoStyles[selector][cssProp] = cssValue;
|
|
231
|
+
} else {
|
|
232
|
+
const bpPx = breakpoints[bp];
|
|
233
|
+
if (bpPx !== void 0) {
|
|
234
|
+
if (!breakpointStyles[bpPx]) breakpointStyles[bpPx] = {};
|
|
235
|
+
breakpointStyles[bpPx][cssProp] = cssValue;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
} else {
|
|
240
|
+
inlineStyle[cssProp] = transform(value);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
addTokenProp(paddingStyles, "padding", props.padding ?? props.p, spacingCss);
|
|
244
|
+
addTokenProp(paddingTopStyles, "padding-top", props.paddingTop ?? props.pt, spacingCss);
|
|
245
|
+
addTokenProp(paddingRightStyles, "padding-right", props.paddingRight ?? props.pr, spacingCss);
|
|
246
|
+
addTokenProp(paddingBottomStyles, "padding-bottom", props.paddingBottom ?? props.pb, spacingCss);
|
|
247
|
+
addTokenProp(paddingLeftStyles, "padding-left", props.paddingLeft ?? props.pl, spacingCss);
|
|
248
|
+
addTokenProp(paddingInlineStyles, "padding-inline", props.paddingHorizontal ?? props.px, spacingCss);
|
|
249
|
+
addTokenProp(paddingBlockStyles, "padding-block", props.paddingVertical ?? props.py, spacingCss);
|
|
250
|
+
addTokenProp(marginStyles, "margin", props.margin ?? props.m, marginCss);
|
|
251
|
+
addTokenProp(marginTopStyles, "margin-top", props.marginTop ?? props.mt, marginCss);
|
|
252
|
+
addTokenProp(marginRightStyles, "margin-right", props.marginRight ?? props.mr, marginCss);
|
|
253
|
+
addTokenProp(marginBottomStyles, "margin-bottom", props.marginBottom ?? props.mb, marginCss);
|
|
254
|
+
addTokenProp(marginLeftStyles, "margin-left", props.marginLeft ?? props.ml, marginCss);
|
|
255
|
+
addTokenProp(marginInlineStyles, "margin-inline", props.marginHorizontal ?? props.mx, marginCss);
|
|
256
|
+
addTokenProp(marginBlockStyles, "margin-block", props.marginVertical ?? props.my, marginCss);
|
|
257
|
+
addTokenProp(gapStyles, "gap", props.gap ?? props.g, spacingCss);
|
|
258
|
+
addTokenProp(rowGapStyles, "row-gap", props.rowGap, spacingCss);
|
|
259
|
+
addTokenProp(columnGapStyles, "column-gap", props.columnGap, spacingCss);
|
|
260
|
+
addTokenProp(backgroundColorStyles, "background-color", props.backgroundColor, backgroundColorCss);
|
|
261
|
+
addTokenProp(colorStyles, "color", props.color, textColorCss);
|
|
262
|
+
addTokenProp(borderColorStyles, "border-color", props.borderColor, borderColorCss);
|
|
263
|
+
addTokenProp(borderRadiusStyles, "border-radius", props.borderRadius, radiusCss);
|
|
264
|
+
addTokenProp(borderTopLeftRadiusStyles, "border-top-left-radius", props.borderTopLeftRadius, radiusCss);
|
|
265
|
+
addTokenProp(borderTopRightRadiusStyles, "border-top-right-radius", props.borderTopRightRadius, radiusCss);
|
|
266
|
+
addTokenProp(borderBottomLeftRadiusStyles, "border-bottom-left-radius", props.borderBottomLeftRadius, radiusCss);
|
|
267
|
+
addTokenProp(borderBottomRightRadiusStyles, "border-bottom-right-radius", props.borderBottomRightRadius, radiusCss);
|
|
268
|
+
addArbitraryProp("borderWidth", props.borderWidth, px);
|
|
269
|
+
addArbitraryProp("borderTopWidth", props.borderTopWidth, px);
|
|
270
|
+
addArbitraryProp("borderRightWidth", props.borderRightWidth, px);
|
|
271
|
+
addArbitraryProp("borderBottomWidth", props.borderBottomWidth, px);
|
|
272
|
+
addArbitraryProp("borderLeftWidth", props.borderLeftWidth, px);
|
|
273
|
+
addTokenProp(borderStyleStyles, "border-style", props.borderStyle, (v) => v);
|
|
274
|
+
addTokenProp(boxShadowStyles, "box-shadow", props.boxShadow, shadowCss);
|
|
275
|
+
addTokenProp(displayStyles, "display", props.display, (v) => v);
|
|
276
|
+
addTokenProp(overflowStyles, "overflow", props.overflow, (v) => v);
|
|
277
|
+
addTokenProp(overflowXStyles, "overflow-x", props.overflowX, (v) => v);
|
|
278
|
+
addTokenProp(overflowYStyles, "overflow-y", props.overflowY, (v) => v);
|
|
279
|
+
addArbitraryProp("width", props.width, sizeValue);
|
|
280
|
+
addArbitraryProp("height", props.height, sizeValue);
|
|
281
|
+
addArbitraryProp("minWidth", props.minWidth, sizeValue);
|
|
282
|
+
addArbitraryProp("maxWidth", props.maxWidth, sizeValue);
|
|
283
|
+
addArbitraryProp("minHeight", props.minHeight, sizeValue);
|
|
284
|
+
addArbitraryProp("maxHeight", props.maxHeight, sizeValue);
|
|
285
|
+
addArbitraryProp("aspectRatio", props.aspectRatio, (v) => v);
|
|
286
|
+
addArbitraryProp("flex", props.flex, (v) => typeof v === "number" ? `${v} ${v} 0%` : v);
|
|
287
|
+
addTokenProp(flexDirectionStyles, "flex-direction", props.flexDirection, (v) => v);
|
|
288
|
+
addTokenProp(flexWrapStyles, "flex-wrap", props.flexWrap, (v) => v);
|
|
289
|
+
addArbitraryProp("flexGrow", props.flexGrow, (v) => v);
|
|
290
|
+
addArbitraryProp("flexShrink", props.flexShrink, (v) => v);
|
|
291
|
+
addArbitraryProp("flexBasis", props.flexBasis, sizeValue);
|
|
292
|
+
addTokenProp(alignItemsStyles, "align-items", props.alignItems, flexKeyword);
|
|
293
|
+
addTokenProp(alignSelfStyles, "align-self", props.alignSelf, flexKeyword);
|
|
294
|
+
addTokenProp(justifyContentStyles, "justify-content", props.justifyContent, flexKeyword);
|
|
295
|
+
addTokenProp(alignContentStyles, "align-content", props.alignContent, flexKeyword);
|
|
296
|
+
addArbitraryProp("gridTemplateColumns", props.gridTemplateColumns, (v) => v);
|
|
297
|
+
addArbitraryProp("gridTemplateRows", props.gridTemplateRows, (v) => v);
|
|
298
|
+
addArbitraryProp("gridTemplateAreas", props.gridTemplateAreas, (v) => v);
|
|
299
|
+
addArbitraryProp("gridColumn", props.gridColumn, (v) => v);
|
|
300
|
+
addArbitraryProp("gridRow", props.gridRow, (v) => v);
|
|
301
|
+
addArbitraryProp("gridArea", props.gridArea, (v) => v);
|
|
302
|
+
addArbitraryProp("gridColumnStart", props.gridColumnStart, (v) => v);
|
|
303
|
+
addArbitraryProp("gridColumnEnd", props.gridColumnEnd, (v) => v);
|
|
304
|
+
addArbitraryProp("gridRowStart", props.gridRowStart, (v) => v);
|
|
305
|
+
addArbitraryProp("gridRowEnd", props.gridRowEnd, (v) => v);
|
|
306
|
+
addTokenProp(gridAutoFlowStyles, "grid-auto-flow", props.gridAutoFlow, (v) => v);
|
|
307
|
+
addArbitraryProp("gridAutoColumns", props.gridAutoColumns, (v) => v);
|
|
308
|
+
addArbitraryProp("gridAutoRows", props.gridAutoRows, (v) => v);
|
|
309
|
+
addTokenProp(positionStyles, "position", props.position, (v) => v);
|
|
310
|
+
addArbitraryProp("top", props.top, sizeValue);
|
|
311
|
+
addArbitraryProp("right", props.right, sizeValue);
|
|
312
|
+
addArbitraryProp("bottom", props.bottom, sizeValue);
|
|
313
|
+
addArbitraryProp("left", props.left, sizeValue);
|
|
314
|
+
addArbitraryProp("inset", props.inset, sizeValue);
|
|
315
|
+
addArbitraryProp("zIndex", props.zIndex, (v) => v);
|
|
316
|
+
addTokenProp(transitionPropertyStyles, "transition-property", props.transitionProperty, transitionPropertyCss);
|
|
317
|
+
addTokenProp(transitionDurationStyles, "transition-duration", props.transitionDuration, durationCss);
|
|
318
|
+
addTokenProp(transitionTimingFunctionStyles, "transition-timing-function", props.transitionTimingFunction ?? props.ease, easingCss);
|
|
319
|
+
addTokenProp(transitionDelayStyles, "transition-delay", props.transitionDelay, durationCss);
|
|
320
|
+
addArbitraryProp("transform", props.transform, (v) => v);
|
|
321
|
+
addArbitraryProp("transformOrigin", props.transformOrigin, (v) => v);
|
|
322
|
+
addArbitraryProp("willChange", props.willChange, (v) => v);
|
|
323
|
+
addArbitraryProp("opacity", props.opacity, (v) => v);
|
|
324
|
+
addTokenProp(cursorStyles, "cursor", props.cursor, (v) => v);
|
|
325
|
+
addTokenProp(pointerEventsStyles, "pointer-events", props.pointerEvents, (v) => v);
|
|
326
|
+
addTokenProp(visibilityStyles, "visibility", props.visibility, (v) => v);
|
|
327
|
+
addTokenProp(userSelectStyles, "user-select", props.userSelect, (v) => v);
|
|
328
|
+
addTokenProp(textAlignStyles, "text-align", props.textAlign, (v) => v);
|
|
329
|
+
const bpKeys = Object.keys(breakpointStyles).map(Number).sort((a, b) => a - b);
|
|
330
|
+
const pseudoKeys = Object.keys(pseudoStyles);
|
|
331
|
+
let responsiveCSS = null;
|
|
332
|
+
if (bpKeys.length > 0 || pseudoKeys.length > 0) {
|
|
333
|
+
const selector = `.${scopeClass}:not(#\\#):not(#\\#):not(#\\#):not(#\\#)`;
|
|
334
|
+
const parts = [];
|
|
335
|
+
for (const bp of bpKeys) {
|
|
336
|
+
const entries = sortedDeclarationEntries(breakpointStyles[bp]).map(([k, v]) => `${normalizedCssKey(k)}: ${v}`).join("; ");
|
|
337
|
+
if (bp === 0) {
|
|
338
|
+
parts.push(`${selector} { ${entries} }`);
|
|
339
|
+
} else {
|
|
340
|
+
parts.push(`@media (min-width: ${bp}px) { ${selector} { ${entries} } }`);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
for (const pseudo of pseudoKeys) {
|
|
344
|
+
const entries = sortedDeclarationEntries(pseudoStyles[pseudo]).map(([k, v]) => `${normalizedCssKey(k)}: ${v}`).join("; ");
|
|
345
|
+
parts.push(`${selector}${pseudo} { ${entries} }`);
|
|
346
|
+
}
|
|
347
|
+
responsiveCSS = parts.join(" ");
|
|
348
|
+
}
|
|
349
|
+
return {
|
|
350
|
+
stylexStyles: sxStyles,
|
|
351
|
+
inlineStyle,
|
|
352
|
+
responsiveCSS
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
export { BOX_STYLE_PROP_KEYS, resolveBoxStyles };
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import type { BackgroundColorToken, BorderColorToken, BorderRadiusToken, BreakpointKey, DurationToken, EasingToken, ShadowToken, SpacingToken, TextColorToken } from '../tokens/tokens.stylex';
|
|
2
|
+
export type PseudoState = 'hover' | 'focus' | 'active' | 'focusVisible' | 'focusWithin';
|
|
3
|
+
export type ResponsiveValue<T> = T | Partial<Record<'base' | BreakpointKey | PseudoState, T>>;
|
|
4
|
+
export interface SpacingProps {
|
|
5
|
+
padding?: ResponsiveValue<SpacingToken>;
|
|
6
|
+
paddingTop?: ResponsiveValue<SpacingToken>;
|
|
7
|
+
paddingRight?: ResponsiveValue<SpacingToken>;
|
|
8
|
+
paddingBottom?: ResponsiveValue<SpacingToken>;
|
|
9
|
+
paddingLeft?: ResponsiveValue<SpacingToken>;
|
|
10
|
+
paddingHorizontal?: ResponsiveValue<SpacingToken>;
|
|
11
|
+
paddingVertical?: ResponsiveValue<SpacingToken>;
|
|
12
|
+
p?: ResponsiveValue<SpacingToken>;
|
|
13
|
+
pt?: ResponsiveValue<SpacingToken>;
|
|
14
|
+
pr?: ResponsiveValue<SpacingToken>;
|
|
15
|
+
pb?: ResponsiveValue<SpacingToken>;
|
|
16
|
+
pl?: ResponsiveValue<SpacingToken>;
|
|
17
|
+
px?: ResponsiveValue<SpacingToken>;
|
|
18
|
+
py?: ResponsiveValue<SpacingToken>;
|
|
19
|
+
margin?: ResponsiveValue<SpacingToken | 'auto'>;
|
|
20
|
+
marginTop?: ResponsiveValue<SpacingToken | 'auto'>;
|
|
21
|
+
marginRight?: ResponsiveValue<SpacingToken | 'auto'>;
|
|
22
|
+
marginBottom?: ResponsiveValue<SpacingToken | 'auto'>;
|
|
23
|
+
marginLeft?: ResponsiveValue<SpacingToken | 'auto'>;
|
|
24
|
+
marginHorizontal?: ResponsiveValue<SpacingToken | 'auto'>;
|
|
25
|
+
marginVertical?: ResponsiveValue<SpacingToken | 'auto'>;
|
|
26
|
+
m?: ResponsiveValue<SpacingToken | 'auto'>;
|
|
27
|
+
mt?: ResponsiveValue<SpacingToken | 'auto'>;
|
|
28
|
+
mr?: ResponsiveValue<SpacingToken | 'auto'>;
|
|
29
|
+
mb?: ResponsiveValue<SpacingToken | 'auto'>;
|
|
30
|
+
ml?: ResponsiveValue<SpacingToken | 'auto'>;
|
|
31
|
+
mx?: ResponsiveValue<SpacingToken | 'auto'>;
|
|
32
|
+
my?: ResponsiveValue<SpacingToken | 'auto'>;
|
|
33
|
+
gap?: ResponsiveValue<SpacingToken>;
|
|
34
|
+
rowGap?: ResponsiveValue<SpacingToken>;
|
|
35
|
+
columnGap?: ResponsiveValue<SpacingToken>;
|
|
36
|
+
g?: ResponsiveValue<SpacingToken>;
|
|
37
|
+
}
|
|
38
|
+
export interface ColorProps {
|
|
39
|
+
backgroundColor?: ResponsiveValue<BackgroundColorToken>;
|
|
40
|
+
color?: ResponsiveValue<TextColorToken>;
|
|
41
|
+
borderColor?: ResponsiveValue<BorderColorToken>;
|
|
42
|
+
}
|
|
43
|
+
export interface BorderProps {
|
|
44
|
+
borderRadius?: ResponsiveValue<BorderRadiusToken>;
|
|
45
|
+
borderTopLeftRadius?: ResponsiveValue<BorderRadiusToken>;
|
|
46
|
+
borderTopRightRadius?: ResponsiveValue<BorderRadiusToken>;
|
|
47
|
+
borderBottomLeftRadius?: ResponsiveValue<BorderRadiusToken>;
|
|
48
|
+
borderBottomRightRadius?: ResponsiveValue<BorderRadiusToken>;
|
|
49
|
+
borderWidth?: ResponsiveValue<number>;
|
|
50
|
+
borderTopWidth?: ResponsiveValue<number>;
|
|
51
|
+
borderRightWidth?: ResponsiveValue<number>;
|
|
52
|
+
borderBottomWidth?: ResponsiveValue<number>;
|
|
53
|
+
borderLeftWidth?: ResponsiveValue<number>;
|
|
54
|
+
borderStyle?: ResponsiveValue<'solid' | 'dashed' | 'dotted' | 'none'>;
|
|
55
|
+
}
|
|
56
|
+
export interface ShadowProps {
|
|
57
|
+
boxShadow?: ResponsiveValue<ShadowToken>;
|
|
58
|
+
}
|
|
59
|
+
export interface LayoutProps {
|
|
60
|
+
display?: ResponsiveValue<'flex' | 'grid' | 'block' | 'inline' | 'inline-flex' | 'inline-grid' | 'inline-block' | 'none' | 'contents'>;
|
|
61
|
+
overflow?: ResponsiveValue<'hidden' | 'auto' | 'scroll' | 'visible'>;
|
|
62
|
+
overflowX?: ResponsiveValue<'hidden' | 'auto' | 'scroll' | 'visible'>;
|
|
63
|
+
overflowY?: ResponsiveValue<'hidden' | 'auto' | 'scroll' | 'visible'>;
|
|
64
|
+
width?: ResponsiveValue<string | number>;
|
|
65
|
+
height?: ResponsiveValue<string | number>;
|
|
66
|
+
minWidth?: ResponsiveValue<string | number>;
|
|
67
|
+
maxWidth?: ResponsiveValue<string | number>;
|
|
68
|
+
minHeight?: ResponsiveValue<string | number>;
|
|
69
|
+
maxHeight?: ResponsiveValue<string | number>;
|
|
70
|
+
aspectRatio?: ResponsiveValue<string>;
|
|
71
|
+
}
|
|
72
|
+
export interface FlexProps {
|
|
73
|
+
flex?: ResponsiveValue<number | string>;
|
|
74
|
+
flexDirection?: ResponsiveValue<'row' | 'column' | 'row-reverse' | 'column-reverse'>;
|
|
75
|
+
flexWrap?: ResponsiveValue<'wrap' | 'nowrap' | 'wrap-reverse'>;
|
|
76
|
+
flexGrow?: ResponsiveValue<number>;
|
|
77
|
+
flexShrink?: ResponsiveValue<number>;
|
|
78
|
+
flexBasis?: ResponsiveValue<string | number>;
|
|
79
|
+
alignItems?: ResponsiveValue<'start' | 'end' | 'center' | 'baseline' | 'stretch'>;
|
|
80
|
+
alignSelf?: ResponsiveValue<'start' | 'end' | 'center' | 'baseline' | 'stretch' | 'auto'>;
|
|
81
|
+
justifyContent?: ResponsiveValue<'start' | 'end' | 'center' | 'between' | 'around' | 'evenly'>;
|
|
82
|
+
alignContent?: ResponsiveValue<'start' | 'end' | 'center' | 'between' | 'around' | 'evenly' | 'stretch'>;
|
|
83
|
+
}
|
|
84
|
+
export interface GridProps {
|
|
85
|
+
gridTemplateColumns?: ResponsiveValue<string>;
|
|
86
|
+
gridTemplateRows?: ResponsiveValue<string>;
|
|
87
|
+
gridTemplateAreas?: ResponsiveValue<string>;
|
|
88
|
+
gridColumn?: ResponsiveValue<string | number>;
|
|
89
|
+
gridRow?: ResponsiveValue<string | number>;
|
|
90
|
+
gridArea?: ResponsiveValue<string>;
|
|
91
|
+
gridColumnStart?: ResponsiveValue<number | string>;
|
|
92
|
+
gridColumnEnd?: ResponsiveValue<number | string>;
|
|
93
|
+
gridRowStart?: ResponsiveValue<number | string>;
|
|
94
|
+
gridRowEnd?: ResponsiveValue<number | string>;
|
|
95
|
+
gridAutoFlow?: ResponsiveValue<'row' | 'column' | 'dense' | 'row-dense' | 'column-dense'>;
|
|
96
|
+
gridAutoColumns?: ResponsiveValue<string>;
|
|
97
|
+
gridAutoRows?: ResponsiveValue<string>;
|
|
98
|
+
}
|
|
99
|
+
export interface PositionProps {
|
|
100
|
+
position?: ResponsiveValue<'relative' | 'absolute' | 'fixed' | 'sticky' | 'static'>;
|
|
101
|
+
top?: ResponsiveValue<string | number>;
|
|
102
|
+
right?: ResponsiveValue<string | number>;
|
|
103
|
+
bottom?: ResponsiveValue<string | number>;
|
|
104
|
+
left?: ResponsiveValue<string | number>;
|
|
105
|
+
inset?: ResponsiveValue<string | number>;
|
|
106
|
+
zIndex?: ResponsiveValue<number | string>;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Curated `transition-property` presets. Keyword values expand to a real
|
|
110
|
+
* property list so authors don't hand-write CSS — `colors` is the common case
|
|
111
|
+
* for token-driven hover states, `common` covers most interactive surfaces.
|
|
112
|
+
*/
|
|
113
|
+
export type TransitionProperty = 'none' | 'all' | 'common' | 'colors' | 'opacity' | 'shadow' | 'transform';
|
|
114
|
+
export interface MotionProps {
|
|
115
|
+
transitionProperty?: ResponsiveValue<TransitionProperty>;
|
|
116
|
+
transitionDuration?: ResponsiveValue<DurationToken>;
|
|
117
|
+
transitionTimingFunction?: ResponsiveValue<EasingToken>;
|
|
118
|
+
/** Alias for `transitionTimingFunction`. */
|
|
119
|
+
ease?: ResponsiveValue<EasingToken>;
|
|
120
|
+
transitionDelay?: ResponsiveValue<DurationToken>;
|
|
121
|
+
transform?: ResponsiveValue<string>;
|
|
122
|
+
transformOrigin?: ResponsiveValue<string>;
|
|
123
|
+
willChange?: ResponsiveValue<string>;
|
|
124
|
+
}
|
|
125
|
+
export interface VisualProps {
|
|
126
|
+
opacity?: ResponsiveValue<number>;
|
|
127
|
+
cursor?: ResponsiveValue<'pointer' | 'default' | 'not-allowed' | 'grab' | 'grabbing' | 'text' | 'move' | 'wait'>;
|
|
128
|
+
pointerEvents?: ResponsiveValue<'none' | 'auto'>;
|
|
129
|
+
visibility?: ResponsiveValue<'visible' | 'hidden'>;
|
|
130
|
+
userSelect?: ResponsiveValue<'none' | 'text' | 'all' | 'auto'>;
|
|
131
|
+
textAlign?: ResponsiveValue<'left' | 'center' | 'right' | 'justify'>;
|
|
132
|
+
}
|
|
133
|
+
export type BoxStyleProps = SpacingProps & ColorProps & BorderProps & ShadowProps & LayoutProps & FlexProps & GridProps & PositionProps & MotionProps & VisualProps;
|
package/package.json
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@jackbernnie/hiyf",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "human-in-your-face — a personal, LLM-safe design system. Forked from Polar's Orbit (Apache-2.0).",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"sideEffects": [
|
|
8
|
+
"*.css"
|
|
9
|
+
],
|
|
10
|
+
"main": "./dist/index.js",
|
|
11
|
+
"module": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"publishConfig": {
|
|
14
|
+
"access": "public"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"src/theme.css",
|
|
19
|
+
"LICENSE",
|
|
20
|
+
"NOTICE"
|
|
21
|
+
],
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
25
|
+
"default": "./dist/index.js"
|
|
26
|
+
},
|
|
27
|
+
"./theme": {
|
|
28
|
+
"types": "./dist/tokens/tokens.stylex.d.ts",
|
|
29
|
+
"default": "./dist/tokens/tokens.stylex.js"
|
|
30
|
+
},
|
|
31
|
+
"./theme.css": "./src/theme.css",
|
|
32
|
+
"./styles.css": "./dist/stylex.css",
|
|
33
|
+
"./*": {
|
|
34
|
+
"types": "./dist/components/*.d.ts",
|
|
35
|
+
"default": "./dist/components/*.js"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"scripts": {
|
|
39
|
+
"build": "rm -rf dist && rollup -c && tsc -p tsconfig.build.json && node scripts/fix-directives.mjs",
|
|
40
|
+
"typecheck": "tsc --noEmit",
|
|
41
|
+
"test": "vitest run",
|
|
42
|
+
"prepublishOnly": "npm run build"
|
|
43
|
+
},
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"@base-ui/react": "^1.5.0",
|
|
46
|
+
"@hugeicons/core-free-icons": "^4.2.0",
|
|
47
|
+
"@hugeicons/react": "^1.1.6",
|
|
48
|
+
"@stylexjs/stylex": "^0.18.2",
|
|
49
|
+
"class-variance-authority": "^0.7.1",
|
|
50
|
+
"clsx": "^2.1.1",
|
|
51
|
+
"cmdk": "^1.1.1",
|
|
52
|
+
"date-fns": "^4.4.0",
|
|
53
|
+
"embla-carousel-react": "^8.6.0",
|
|
54
|
+
"input-otp": "^1.4.2",
|
|
55
|
+
"next-themes": "^0.4.6",
|
|
56
|
+
"radix-ui": "^1.6.0",
|
|
57
|
+
"react-day-picker": "^10.0.1",
|
|
58
|
+
"react-resizable-panels": "^4.11.2",
|
|
59
|
+
"recharts": "^3.8.0",
|
|
60
|
+
"sonner": "^2.0.7",
|
|
61
|
+
"tailwind-merge": "^3.6.0",
|
|
62
|
+
"vaul": "^1.1.2"
|
|
63
|
+
},
|
|
64
|
+
"devDependencies": {
|
|
65
|
+
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
66
|
+
"@stylexjs/rollup-plugin": "0.18.3",
|
|
67
|
+
"@types/react": "^19.2.0",
|
|
68
|
+
"@types/react-dom": "^19.2.0",
|
|
69
|
+
"rollup": "^4.62.0",
|
|
70
|
+
"rollup-plugin-esbuild": "^6.2.1",
|
|
71
|
+
"rollup-plugin-preserve-directives": "^0.4.0",
|
|
72
|
+
"tsup": "^8.5.1",
|
|
73
|
+
"typescript": "^5.7.0",
|
|
74
|
+
"vitest": "^3.2.4"
|
|
75
|
+
},
|
|
76
|
+
"peerDependencies": {
|
|
77
|
+
"react": "^18 || ^19",
|
|
78
|
+
"react-dom": "^18 || ^19"
|
|
79
|
+
}
|
|
80
|
+
}
|