@sanity-labs/ui-poc 0.0.1-alpha.0 → 0.0.1-alpha.1
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/package.json +7 -9
- package/src/components/box/Box.tsx +4 -3
- package/src/components/card/Card.tsx +0 -0
- package/src/components/card/card.props.ts +21 -0
- package/src/components/divider/Divider.tsx +11 -0
- package/src/components/flex/Flex.tsx +6 -3
- package/src/components/grid/Grid.tsx +7 -4
- package/src/index.ts +5 -1
- package/src/types/Density.ts +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity-labs/ui-poc",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.1",
|
|
4
4
|
"description": "Sanity UI POC",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"homepage": "https://github.com/sanity-labs/ui-poc#readme",
|
|
@@ -13,7 +13,9 @@
|
|
|
13
13
|
},
|
|
14
14
|
"license": "ISC",
|
|
15
15
|
"author": "Sanity",
|
|
16
|
-
"sideEffects":
|
|
16
|
+
"sideEffects": [
|
|
17
|
+
"*.css"
|
|
18
|
+
],
|
|
17
19
|
"type": "module",
|
|
18
20
|
"exports": {
|
|
19
21
|
".": {
|
|
@@ -55,19 +57,15 @@
|
|
|
55
57
|
"classnames": "^2.5.1"
|
|
56
58
|
},
|
|
57
59
|
"devDependencies": {
|
|
60
|
+
"@repo/eslint-config": "workspace:*",
|
|
61
|
+
"@sanity/browserslist-config": "^1.0.5",
|
|
58
62
|
"@sanity/pkg-utils": "^9.2.3",
|
|
59
63
|
"@sanity/prettier-config": "^1.0.6",
|
|
60
64
|
"@sanity/tsconfig": "^1.0.0",
|
|
61
65
|
"@types/postcss-import": "^14.0.3",
|
|
62
66
|
"@types/react": "^19.2.14",
|
|
63
|
-
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
64
|
-
"@typescript-eslint/parser": "^7.18.0",
|
|
65
67
|
"autoprefixer": "^10.4.27",
|
|
66
|
-
"eslint": "^
|
|
67
|
-
"eslint-config-prettier": "^9.1.2",
|
|
68
|
-
"eslint-plugin-import": "^2.32.0",
|
|
69
|
-
"eslint-plugin-prettier": "^5.5.5",
|
|
70
|
-
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
68
|
+
"eslint": "^9.22.0",
|
|
71
69
|
"lint-staged": "^15.5.2",
|
|
72
70
|
"postcss": "^8.5.8",
|
|
73
71
|
"postcss-cli": "^11.0.1",
|
|
@@ -16,9 +16,10 @@ export interface BoxProps<T extends React.ElementType> extends LayoutProps {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
/** @public */
|
|
19
|
-
export function Box<T extends React.ElementType = 'div'>(
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
export function Box<T extends React.ElementType = 'div'>({
|
|
20
|
+
display = 'block',
|
|
21
|
+
...props
|
|
22
|
+
}: BoxProps<T> & Omit<React.ComponentPropsWithRef<T>, keyof BoxProps<T>>) {
|
|
22
23
|
const {as, children, className, style, ...rest} = getProps({display, ...props}, boxProps)
|
|
23
24
|
const Component = as || 'div'
|
|
24
25
|
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {marginProps} from '../../props/margin'
|
|
2
|
+
import {DENSITY} from '../../types/Density'
|
|
3
|
+
import {DISPLAY_BLOCK} from '../../types/Display'
|
|
4
|
+
import {type PropDef} from '../../types/PropDef'
|
|
5
|
+
|
|
6
|
+
export const cardProps: Record<string, PropDef> = {
|
|
7
|
+
as: {
|
|
8
|
+
type: 'string',
|
|
9
|
+
},
|
|
10
|
+
display: {
|
|
11
|
+
type: 'union',
|
|
12
|
+
className: 'display',
|
|
13
|
+
values: DISPLAY_BLOCK,
|
|
14
|
+
},
|
|
15
|
+
density: {
|
|
16
|
+
type: 'composite',
|
|
17
|
+
classNames: ['', 'padding3 radius2', 'padding4 radius3', 'padding5 radius4'],
|
|
18
|
+
values: DENSITY,
|
|
19
|
+
},
|
|
20
|
+
...marginProps,
|
|
21
|
+
}
|
|
@@ -9,6 +9,7 @@ import {type Responsive} from '../../types/Responsive'
|
|
|
9
9
|
import {getProps} from '../../utils/getProps'
|
|
10
10
|
import {flexProps} from './flex.props'
|
|
11
11
|
|
|
12
|
+
/** @public */
|
|
12
13
|
export interface FlexProps<T extends React.ElementType>
|
|
13
14
|
extends FlexParentProps, GapProps, LayoutProps {
|
|
14
15
|
/** Element to render */
|
|
@@ -17,9 +18,11 @@ export interface FlexProps<T extends React.ElementType>
|
|
|
17
18
|
display?: Responsive<DisplayFlex>
|
|
18
19
|
}
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
/** @public */
|
|
22
|
+
export function Flex<T extends React.ElementType = 'div'>({
|
|
23
|
+
display = 'flex',
|
|
24
|
+
...props
|
|
25
|
+
}: FlexProps<T> & Omit<React.ComponentPropsWithRef<T>, keyof FlexProps<T>>) {
|
|
23
26
|
const {as, children, className, style, ...rest} = getProps({display, ...props}, flexProps)
|
|
24
27
|
const Component = as || 'div'
|
|
25
28
|
|
|
@@ -9,7 +9,8 @@ import {type Responsive} from '../../types/Responsive'
|
|
|
9
9
|
import {getProps} from '../../utils/getProps'
|
|
10
10
|
import {gridProps} from './grid.props'
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
/** @public */
|
|
13
|
+
export interface GridProps<T extends React.ElementType>
|
|
13
14
|
extends GridParentProps, GapProps, LayoutProps {
|
|
14
15
|
/** Element to render */
|
|
15
16
|
as?: T
|
|
@@ -17,9 +18,11 @@ export interface FlexProps<T extends React.ElementType>
|
|
|
17
18
|
display?: Responsive<DisplayGrid>
|
|
18
19
|
}
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
/** @public */
|
|
22
|
+
export function Grid<T extends React.ElementType = 'div'>({
|
|
23
|
+
display = 'grid',
|
|
24
|
+
...props
|
|
25
|
+
}: GridProps<T> & Omit<React.ComponentPropsWithRef<T>, keyof GridProps<T>>) {
|
|
23
26
|
const {as, children, className, style, ...rest} = getProps({display, ...props}, gridProps)
|
|
24
27
|
const Component = as || 'div'
|
|
25
28
|
|
package/src/index.ts
CHANGED