@pittorica/section-react 0.24.0 → 0.26.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/README.md +10 -2
- package/dist/Section.d.ts +12 -4
- package/dist/Section.d.ts.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +72 -79
- package/package.json +9 -9
- package/dist/Section.stories.d.ts +0 -11
- package/dist/Section.stories.d.ts.map +0 -1
- package/dist/Section.test.d.ts +0 -5
- package/dist/Section.test.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -11,8 +11,16 @@ npm install @pittorica/section-react
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
13
|
```jsx
|
|
14
|
-
import { Section } from '@pittorica/
|
|
15
|
-
|
|
14
|
+
import { Section, Heading, Text } from '@pittorica/react';
|
|
15
|
+
|
|
16
|
+
function MyPage() {
|
|
17
|
+
return (
|
|
18
|
+
<Section size="3">
|
|
19
|
+
<Heading>About Us</Heading>
|
|
20
|
+
<Text>Modular and accessible design system.</Text>
|
|
21
|
+
</Section>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
16
24
|
```
|
|
17
25
|
|
|
18
26
|
## License
|
package/dist/Section.d.ts
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
|
+
import { type ElementType } from 'react';
|
|
1
2
|
import { type BoxProps } from '@pittorica/box-react';
|
|
2
|
-
export
|
|
3
|
+
export type SectionProps<E extends ElementType = 'section'> = BoxProps<E> & {
|
|
3
4
|
/**
|
|
4
5
|
* Vertical padding size.
|
|
5
6
|
* Maps to responsive padding values in CSS.
|
|
6
7
|
* @default '3'
|
|
7
8
|
*/
|
|
8
|
-
size?: '1' | '2' | '3';
|
|
9
|
-
}
|
|
10
|
-
|
|
9
|
+
size?: '1' | '2' | '3' | '4';
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Section component for high-level page layout.
|
|
13
|
+
* Fully polymorphic and agnostic foundation.
|
|
14
|
+
*/
|
|
15
|
+
export declare const Section: {
|
|
16
|
+
<E extends ElementType = "section">({ children, as, size, className, ...props }: SectionProps<E>): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
displayName: string;
|
|
18
|
+
};
|
|
11
19
|
//# sourceMappingURL=Section.d.ts.map
|
package/dist/Section.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Section.d.ts","sourceRoot":"","sources":["../src/Section.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Section.d.ts","sourceRoot":"","sources":["../src/Section.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,OAAO,CAAC;AAIzC,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAE1D,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,WAAW,GAAG,SAAS,IAAI,QAAQ,CAAC,CAAC,CAAC,GAAG;IAC1E;;;;OAIG;IACH,IAAI,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;CAC9B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,OAAO;KAAI,CAAC,SAAS,WAAW,2DAM1C,YAAY,CAAC,CAAC,CAAC;;CAajB,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,100 +1,93 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
function
|
|
3
|
-
var
|
|
4
|
-
if (typeof
|
|
5
|
-
else if (typeof
|
|
6
|
-
var o =
|
|
7
|
-
for (
|
|
8
|
-
} else for (
|
|
9
|
-
return
|
|
1
|
+
import { jsx as x } from "react/jsx-runtime";
|
|
2
|
+
function T(i) {
|
|
3
|
+
var p, r, a = "";
|
|
4
|
+
if (typeof i == "string" || typeof i == "number") a += i;
|
|
5
|
+
else if (typeof i == "object") if (Array.isArray(i)) {
|
|
6
|
+
var o = i.length;
|
|
7
|
+
for (p = 0; p < o; p++) i[p] && (r = T(i[p])) && (a && (a += " "), a += r);
|
|
8
|
+
} else for (r in i) i[r] && (a && (a += " "), a += r);
|
|
9
|
+
return a;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
for (var
|
|
13
|
-
return
|
|
11
|
+
function k() {
|
|
12
|
+
for (var i, p, r = 0, a = "", o = arguments.length; r < o; r++) (i = arguments[r]) && (p = T(i)) && (a && (a += " "), a += p);
|
|
13
|
+
return a;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
var
|
|
17
|
-
if (typeof
|
|
18
|
-
else if (typeof
|
|
19
|
-
var o =
|
|
20
|
-
for (
|
|
21
|
-
} else for (
|
|
22
|
-
return
|
|
15
|
+
function N(i) {
|
|
16
|
+
var p, r, a = "";
|
|
17
|
+
if (typeof i == "string" || typeof i == "number") a += i;
|
|
18
|
+
else if (typeof i == "object") if (Array.isArray(i)) {
|
|
19
|
+
var o = i.length;
|
|
20
|
+
for (p = 0; p < o; p++) i[p] && (r = N(i[p])) && (a && (a += " "), a += r);
|
|
21
|
+
} else for (r in i) i[r] && (a && (a += " "), a += r);
|
|
22
|
+
return a;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
for (var
|
|
26
|
-
return
|
|
24
|
+
function z() {
|
|
25
|
+
for (var i, p, r = 0, a = "", o = arguments.length; r < o; r++) (i = arguments[r]) && (p = N(i)) && (a && (a += " "), a += p);
|
|
26
|
+
return a;
|
|
27
27
|
}
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
28
|
+
const A = ({
|
|
29
|
+
as: i,
|
|
30
|
+
children: p,
|
|
31
|
+
display: r,
|
|
32
|
+
m: a,
|
|
33
|
+
mt: o,
|
|
34
|
+
mr: e,
|
|
35
|
+
mb: d,
|
|
36
|
+
ml: m,
|
|
37
|
+
mx: c,
|
|
38
|
+
my: s,
|
|
38
39
|
p: f,
|
|
39
|
-
pt:
|
|
40
|
+
pt: v,
|
|
40
41
|
pr: l,
|
|
41
|
-
pb:
|
|
42
|
-
pl:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
type: L,
|
|
53
|
-
name: R,
|
|
54
|
-
disabled: T,
|
|
42
|
+
pb: u,
|
|
43
|
+
pl: y,
|
|
44
|
+
px: n,
|
|
45
|
+
py: g,
|
|
46
|
+
width: $,
|
|
47
|
+
height: h,
|
|
48
|
+
position: b,
|
|
49
|
+
style: B,
|
|
50
|
+
className: L,
|
|
51
|
+
disabled: R,
|
|
52
|
+
required: j,
|
|
55
53
|
...q
|
|
56
54
|
}) => {
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
...
|
|
61
|
-
...
|
|
55
|
+
const S = i || "div", t = {};
|
|
56
|
+
r && (t.display = r), $ && (t.width = $), h && (t.height = h), b && (t.position = b), a && (t.margin = `var(--pittorica-space-${a})`), o && (t.marginTop = `var(--pittorica-space-${o})`), e && (t.marginRight = `var(--pittorica-space-${e})`), d && (t.marginBottom = `var(--pittorica-space-${d})`), m && (t.marginLeft = `var(--pittorica-space-${m})`), c && (t.marginLeft = `var(--pittorica-space-${c})`, t.marginRight = `var(--pittorica-space-${c})`), s && (t.marginTop = `var(--pittorica-space-${s})`, t.marginBottom = `var(--pittorica-space-${s})`), f && (t.padding = `var(--pittorica-space-${f})`), v && (t.paddingTop = `var(--pittorica-space-${v})`), l && (t.paddingRight = `var(--pittorica-space-${l})`), u && (t.paddingBottom = `var(--pittorica-space-${u})`), y && (t.paddingLeft = `var(--pittorica-space-${y})`), n && (t.paddingLeft = `var(--pittorica-space-${n})`, t.paddingRight = `var(--pittorica-space-${n})`), g && (t.paddingTop = `var(--pittorica-space-${g})`, t.paddingBottom = `var(--pittorica-space-${g})`);
|
|
57
|
+
const w = {
|
|
58
|
+
...B,
|
|
59
|
+
...t
|
|
62
60
|
};
|
|
63
|
-
return /* @__PURE__ */
|
|
64
|
-
|
|
61
|
+
return /* @__PURE__ */ x(
|
|
62
|
+
S,
|
|
65
63
|
{
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
target: w,
|
|
71
|
-
rel: B,
|
|
72
|
-
htmlFor: F,
|
|
73
|
-
type: L,
|
|
74
|
-
name: R,
|
|
75
|
-
disabled: T,
|
|
64
|
+
className: z("pittorica-box", L),
|
|
65
|
+
style: w,
|
|
66
|
+
disabled: R,
|
|
67
|
+
required: j,
|
|
76
68
|
...q,
|
|
77
|
-
children:
|
|
69
|
+
children: p
|
|
78
70
|
}
|
|
79
71
|
);
|
|
80
72
|
};
|
|
81
|
-
|
|
82
|
-
const
|
|
83
|
-
children:
|
|
84
|
-
as:
|
|
85
|
-
size:
|
|
86
|
-
className:
|
|
73
|
+
A.displayName = "Box";
|
|
74
|
+
const C = ({
|
|
75
|
+
children: i,
|
|
76
|
+
as: p,
|
|
77
|
+
size: r = "3",
|
|
78
|
+
className: a,
|
|
87
79
|
...o
|
|
88
|
-
}) => /* @__PURE__ */
|
|
89
|
-
|
|
80
|
+
}) => /* @__PURE__ */ x(
|
|
81
|
+
A,
|
|
90
82
|
{
|
|
91
|
-
as:
|
|
92
|
-
className:
|
|
93
|
-
"data-size":
|
|
83
|
+
as: p || "section",
|
|
84
|
+
className: k("pittorica-section", a),
|
|
85
|
+
"data-size": r,
|
|
94
86
|
...o,
|
|
95
|
-
children:
|
|
87
|
+
children: i
|
|
96
88
|
}
|
|
97
89
|
);
|
|
90
|
+
C.displayName = "Section";
|
|
98
91
|
export {
|
|
99
|
-
|
|
92
|
+
C as Section
|
|
100
93
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pittorica/section-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.0",
|
|
4
|
+
"homepage": "https://pittorica.dcdavidev.me",
|
|
4
5
|
"type": "module",
|
|
5
6
|
"main": "./dist/index.js",
|
|
6
7
|
"module": "./dist/index.js",
|
|
@@ -10,7 +11,7 @@
|
|
|
10
11
|
],
|
|
11
12
|
"dependencies": {
|
|
12
13
|
"clsx": "^2.1.1",
|
|
13
|
-
"@pittorica/box-react": "0.
|
|
14
|
+
"@pittorica/box-react": "0.26.0"
|
|
14
15
|
},
|
|
15
16
|
"devDependencies": {
|
|
16
17
|
"@testing-library/jest-dom": "^6.9.1",
|
|
@@ -20,11 +21,11 @@
|
|
|
20
21
|
"@vitejs/plugin-react": "^4.0.0",
|
|
21
22
|
"jsdom": "^22.0.0",
|
|
22
23
|
"typescript": "^5.0.0",
|
|
23
|
-
"vite": "^
|
|
24
|
-
"vitest": "^2.
|
|
25
|
-
"@pittorica/theme-react": "0.
|
|
26
|
-
"pittorica": "0.
|
|
27
|
-
"@pittorica/text-react": "0.
|
|
24
|
+
"vite": "^6.4.1",
|
|
25
|
+
"vitest": "^3.2.4",
|
|
26
|
+
"@pittorica/theme-react": "0.26.0",
|
|
27
|
+
"pittorica": "0.26.0",
|
|
28
|
+
"@pittorica/text-react": "0.26.0"
|
|
28
29
|
},
|
|
29
30
|
"peerDependencies": {
|
|
30
31
|
"react": ">=19",
|
|
@@ -34,8 +35,7 @@
|
|
|
34
35
|
"build": "npm run clean && npm run build:js && npm run build:types",
|
|
35
36
|
"build:js": "vite build",
|
|
36
37
|
"build:types": "tsc -p tsconfig.json",
|
|
37
|
-
"clean": "rm -rf dist",
|
|
38
|
-
"dev": "vite",
|
|
38
|
+
"clean": "rm -rf dist *.tsbuildinfo",
|
|
39
39
|
"test": "vitest run",
|
|
40
40
|
"test:watch": "vitest"
|
|
41
41
|
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Section } from './Section';
|
|
3
|
-
declare const meta: Meta<typeof Section>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof Section>;
|
|
6
|
-
export declare const Default: Story;
|
|
7
|
-
export declare const SmallSize: Story;
|
|
8
|
-
export declare const MediumSize: Story;
|
|
9
|
-
export declare const LargeSize: Story;
|
|
10
|
-
export declare const AsDiv: Story;
|
|
11
|
-
//# sourceMappingURL=Section.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Section.stories.d.ts","sourceRoot":"","sources":["../src/Section.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,OAAO,CAiB9B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,OAAO,CAAC,CAAC;AAiBtC,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAMvB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAMxB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAMvB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAOnB,CAAC"}
|
package/dist/Section.test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Section.test.d.ts","sourceRoot":"","sources":["../src/Section.test.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,2BAA2B,CAAC"}
|