@pittorica/section-react 0.25.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 +2 -2
- 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 +30 -28
- package/package.json +9 -8
- 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
|
@@ -6,11 +6,11 @@ export type SectionProps<E extends ElementType = 'section'> = BoxProps<E> & {
|
|
|
6
6
|
* Maps to responsive padding values in CSS.
|
|
7
7
|
* @default '3'
|
|
8
8
|
*/
|
|
9
|
-
size?: '1' | '2' | '3';
|
|
9
|
+
size?: '1' | '2' | '3' | '4';
|
|
10
10
|
};
|
|
11
11
|
/**
|
|
12
12
|
* Section component for high-level page layout.
|
|
13
|
-
* Fully polymorphic and agnostic.
|
|
13
|
+
* Fully polymorphic and agnostic foundation.
|
|
14
14
|
*/
|
|
15
15
|
export declare const Section: {
|
|
16
16
|
<E extends ElementType = "section">({ children, as, size, className, ...props }: SectionProps<E>): import("react/jsx-runtime").JSX.Element;
|
package/dist/Section.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,CAAC;
|
|
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,78 +1,80 @@
|
|
|
1
1
|
import { jsx as x } from "react/jsx-runtime";
|
|
2
2
|
function T(i) {
|
|
3
|
-
var p,
|
|
3
|
+
var p, r, a = "";
|
|
4
4
|
if (typeof i == "string" || typeof i == "number") a += i;
|
|
5
5
|
else if (typeof i == "object") if (Array.isArray(i)) {
|
|
6
6
|
var o = i.length;
|
|
7
|
-
for (p = 0; p < o; p++) i[p] && (
|
|
8
|
-
} else for (
|
|
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
9
|
return a;
|
|
10
10
|
}
|
|
11
11
|
function k() {
|
|
12
|
-
for (var i, p,
|
|
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
13
|
return a;
|
|
14
14
|
}
|
|
15
15
|
function N(i) {
|
|
16
|
-
var p,
|
|
16
|
+
var p, r, a = "";
|
|
17
17
|
if (typeof i == "string" || typeof i == "number") a += i;
|
|
18
18
|
else if (typeof i == "object") if (Array.isArray(i)) {
|
|
19
19
|
var o = i.length;
|
|
20
|
-
for (p = 0; p < o; p++) i[p] && (
|
|
21
|
-
} else for (
|
|
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
22
|
return a;
|
|
23
23
|
}
|
|
24
24
|
function z() {
|
|
25
|
-
for (var i, p,
|
|
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
26
|
return a;
|
|
27
27
|
}
|
|
28
28
|
const A = ({
|
|
29
29
|
as: i,
|
|
30
30
|
children: p,
|
|
31
|
-
display:
|
|
31
|
+
display: r,
|
|
32
32
|
m: a,
|
|
33
33
|
mt: o,
|
|
34
34
|
mr: e,
|
|
35
|
-
mb:
|
|
36
|
-
ml:
|
|
35
|
+
mb: d,
|
|
36
|
+
ml: m,
|
|
37
37
|
mx: c,
|
|
38
38
|
my: s,
|
|
39
39
|
p: f,
|
|
40
40
|
pt: v,
|
|
41
41
|
pr: l,
|
|
42
|
-
pb:
|
|
43
|
-
pl:
|
|
42
|
+
pb: u,
|
|
43
|
+
pl: y,
|
|
44
44
|
px: n,
|
|
45
45
|
py: g,
|
|
46
|
-
width:
|
|
47
|
-
height:
|
|
46
|
+
width: $,
|
|
47
|
+
height: h,
|
|
48
48
|
position: b,
|
|
49
49
|
style: B,
|
|
50
50
|
className: L,
|
|
51
51
|
disabled: R,
|
|
52
|
-
|
|
52
|
+
required: j,
|
|
53
|
+
...q
|
|
53
54
|
}) => {
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
const
|
|
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 = {
|
|
57
58
|
...B,
|
|
58
|
-
...
|
|
59
|
+
...t
|
|
59
60
|
};
|
|
60
61
|
return /* @__PURE__ */ x(
|
|
61
|
-
|
|
62
|
+
S,
|
|
62
63
|
{
|
|
63
64
|
className: z("pittorica-box", L),
|
|
64
|
-
style:
|
|
65
|
+
style: w,
|
|
65
66
|
disabled: R,
|
|
66
|
-
|
|
67
|
+
required: j,
|
|
68
|
+
...q,
|
|
67
69
|
children: p
|
|
68
70
|
}
|
|
69
71
|
);
|
|
70
72
|
};
|
|
71
73
|
A.displayName = "Box";
|
|
72
|
-
const
|
|
74
|
+
const C = ({
|
|
73
75
|
children: i,
|
|
74
76
|
as: p,
|
|
75
|
-
size:
|
|
77
|
+
size: r = "3",
|
|
76
78
|
className: a,
|
|
77
79
|
...o
|
|
78
80
|
}) => /* @__PURE__ */ x(
|
|
@@ -80,12 +82,12 @@ const q = ({
|
|
|
80
82
|
{
|
|
81
83
|
as: p || "section",
|
|
82
84
|
className: k("pittorica-section", a),
|
|
83
|
-
"data-size":
|
|
85
|
+
"data-size": r,
|
|
84
86
|
...o,
|
|
85
87
|
children: i
|
|
86
88
|
}
|
|
87
89
|
);
|
|
88
|
-
|
|
90
|
+
C.displayName = "Section";
|
|
89
91
|
export {
|
|
90
|
-
|
|
92
|
+
C as Section
|
|
91
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/
|
|
26
|
-
"
|
|
27
|
-
"pittorica": "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,7 +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
|
+
"clean": "rm -rf dist *.tsbuildinfo",
|
|
38
39
|
"test": "vitest run",
|
|
39
40
|
"test:watch": "vitest"
|
|
40
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"}
|