@dmitriikapustin/ui 0.4.2 → 0.4.3
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/index.cjs +26 -5
- package/dist/index.d.cts +19 -10
- package/dist/index.d.ts +19 -10
- package/dist/index.js +26 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1690,10 +1690,9 @@ function Skeleton({ variant = "line", width, height, className = "" }) {
|
|
|
1690
1690
|
|
|
1691
1691
|
// css-inject-scss:/Users/dimakozh/Desktop/projects/kapustin.cc/packages/ui/src/atoms/SectionHeading.module.scss
|
|
1692
1692
|
__styleInject(`@charset "UTF-8";
|
|
1693
|
-
/* SectionHeading \u2014 \
|
|
1694
|
-
\
|
|
1693
|
+
/* SectionHeading \u2014 \u0442\u0438\u043F\u043E\u0433\u0440\u0430\u0444\u0438\u043A\u0430 \u0434\u043B\u044F section-headings.
|
|
1694
|
+
\u0422\u0440\u0438 \u0440\u0430\u0437\u043C\u0435\u0440\u0430: sm (sub-block), md (default, typical section h2), lg (landing promo). */
|
|
1695
1695
|
.SectionHeading-module_heading {
|
|
1696
|
-
font-size: clamp(1.75rem, 4vw, 2.75rem);
|
|
1697
1696
|
font-weight: 700;
|
|
1698
1697
|
line-height: 1.1;
|
|
1699
1698
|
letter-spacing: -0.03em;
|
|
@@ -1702,6 +1701,21 @@ __styleInject(`@charset "UTF-8";
|
|
|
1702
1701
|
margin: 0;
|
|
1703
1702
|
}
|
|
1704
1703
|
|
|
1704
|
+
/* \u2014 \u0420\u0430\u0437\u043C\u0435\u0440\u044B (responsive clamp) \u2014 */
|
|
1705
|
+
.SectionHeading-module_sizeSm {
|
|
1706
|
+
font-size: clamp(1.125rem, 2.5vw, 1.375rem);
|
|
1707
|
+
letter-spacing: -0.02em;
|
|
1708
|
+
}
|
|
1709
|
+
|
|
1710
|
+
.SectionHeading-module_sizeMd {
|
|
1711
|
+
font-size: clamp(1.5rem, 3vw, 2rem);
|
|
1712
|
+
}
|
|
1713
|
+
|
|
1714
|
+
.SectionHeading-module_sizeLg {
|
|
1715
|
+
font-size: clamp(1.75rem, 4vw, 2.75rem);
|
|
1716
|
+
}
|
|
1717
|
+
|
|
1718
|
+
/* \u2014 \u0412\u044B\u0440\u0430\u0432\u043D\u0438\u0432\u0430\u043D\u0438\u0435 \u2014 */
|
|
1705
1719
|
.SectionHeading-module_alignLeft {
|
|
1706
1720
|
text-align: left;
|
|
1707
1721
|
}
|
|
@@ -1710,6 +1724,7 @@ __styleInject(`@charset "UTF-8";
|
|
|
1710
1724
|
text-align: center;
|
|
1711
1725
|
}
|
|
1712
1726
|
|
|
1727
|
+
/* \u2014 Wrapper \u0434\u043B\u044F subtitle \u2014 */
|
|
1713
1728
|
.SectionHeading-module_wrap {
|
|
1714
1729
|
display: flex;
|
|
1715
1730
|
flex-direction: column;
|
|
@@ -1737,15 +1752,21 @@ __styleInject(`@charset "UTF-8";
|
|
|
1737
1752
|
font-size: 1.125rem;
|
|
1738
1753
|
}
|
|
1739
1754
|
}`);
|
|
1740
|
-
var __default20 = { "heading": "SectionHeading-module_heading", "alignLeft": "SectionHeading-module_alignLeft", "alignCenter": "SectionHeading-module_alignCenter", "wrap": "SectionHeading-module_wrap", "wrapCenter": "SectionHeading-module_wrapCenter", "subtitle": "SectionHeading-module_subtitle" };
|
|
1755
|
+
var __default20 = { "heading": "SectionHeading-module_heading", "sizeSm": "SectionHeading-module_sizeSm", "sizeMd": "SectionHeading-module_sizeMd", "sizeLg": "SectionHeading-module_sizeLg", "alignLeft": "SectionHeading-module_alignLeft", "alignCenter": "SectionHeading-module_alignCenter", "wrap": "SectionHeading-module_wrap", "wrapCenter": "SectionHeading-module_wrapCenter", "subtitle": "SectionHeading-module_subtitle" };
|
|
1756
|
+
var SIZE_CLASS = {
|
|
1757
|
+
sm: __default20.sizeSm,
|
|
1758
|
+
md: __default20.sizeMd,
|
|
1759
|
+
lg: __default20.sizeLg
|
|
1760
|
+
};
|
|
1741
1761
|
function SectionHeading({
|
|
1742
1762
|
children,
|
|
1763
|
+
size = "md",
|
|
1743
1764
|
as = "h2",
|
|
1744
1765
|
align = "left",
|
|
1745
1766
|
subtitle,
|
|
1746
1767
|
className = ""
|
|
1747
1768
|
}) {
|
|
1748
|
-
const headingClass = `${__default20.heading} ${align === "center" ? __default20.alignCenter : __default20.alignLeft}${className ? ` ${className}` : ""}`;
|
|
1769
|
+
const headingClass = `${__default20.heading} ${SIZE_CLASS[size]} ${align === "center" ? __default20.alignCenter : __default20.alignLeft}${className ? ` ${className}` : ""}`;
|
|
1749
1770
|
if (subtitle) {
|
|
1750
1771
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: align === "center" ? __default20.wrapCenter : __default20.wrap, children: [
|
|
1751
1772
|
react.createElement(as, { className: headingClass }, children),
|
package/dist/index.d.cts
CHANGED
|
@@ -203,9 +203,17 @@ declare function Skeleton({ variant, width, height, className }: SkeletonProps):
|
|
|
203
203
|
|
|
204
204
|
type HeadingTag = 'h1' | 'h2' | 'h3';
|
|
205
205
|
type HeadingAlign = 'left' | 'center';
|
|
206
|
+
type HeadingSize = 'sm' | 'md' | 'lg';
|
|
206
207
|
interface SectionHeadingProps {
|
|
207
208
|
children: ReactNode;
|
|
208
|
-
/**
|
|
209
|
+
/**
|
|
210
|
+
* Размер заголовка (responsive clamp).
|
|
211
|
+
* - `'sm'` — `clamp(1.125rem, 2.5vw, 1.375rem)` ≈ 18-22px. Sub-block heading, card group titles.
|
|
212
|
+
* - `'md'` (default) — `clamp(1.5rem, 3vw, 2rem)` ≈ 24-32px. Typical section h2 (industry-standard).
|
|
213
|
+
* - `'lg'` — `clamp(1.75rem, 4vw, 2.75rem)` ≈ 28-44px. Landing promo section (= PromoSplit/PromoTestimonials).
|
|
214
|
+
*/
|
|
215
|
+
size?: HeadingSize;
|
|
216
|
+
/** HTML-тег. Default `'h2'`. Не привязан к size — используй для семантики. */
|
|
209
217
|
as?: HeadingTag;
|
|
210
218
|
/** Выравнивание. Default `'left'`. */
|
|
211
219
|
align?: HeadingAlign;
|
|
@@ -214,20 +222,21 @@ interface SectionHeadingProps {
|
|
|
214
222
|
className?: string;
|
|
215
223
|
}
|
|
216
224
|
/**
|
|
217
|
-
* Единый source для section-
|
|
218
|
-
*
|
|
219
|
-
*
|
|
225
|
+
* Единый source типографики для section-headings во всём пакете и потребителях.
|
|
226
|
+
* Три размера:
|
|
227
|
+
* - `sm` (18-22px) — подсекции, group titles.
|
|
228
|
+
* - `md` (24-32px, default) — typical section h2 (industry-standard: shadcn / Tailwind UI / Linear).
|
|
229
|
+
* - `lg` (28-44px) — landing promo headings (идентично PromoSplit/PromoTestimonials).
|
|
220
230
|
*
|
|
221
|
-
*
|
|
222
|
-
* без встроенного title и вынужден захардкоживать ту же типографику в своём `.heading`
|
|
223
|
-
* — теперь импортирует `<SectionHeading>` и получает единый стиль автоматически.
|
|
231
|
+
* Прop `as` (h1/h2/h3) независим от `size` — используй для семантики:
|
|
224
232
|
*
|
|
225
233
|
* ```tsx
|
|
226
|
-
* <SectionHeading
|
|
227
|
-
* <
|
|
234
|
+
* <SectionHeading>Section h2 — default md size</SectionHeading>
|
|
235
|
+
* <SectionHeading size="lg" as="h1">Landing hero h1 — large</SectionHeading>
|
|
236
|
+
* <SectionHeading size="sm" as="h3">Subsection</SectionHeading>
|
|
228
237
|
* ```
|
|
229
238
|
*/
|
|
230
|
-
declare function SectionHeading({ children, as, align, subtitle, className, }: SectionHeadingProps): react_jsx_runtime.JSX.Element;
|
|
239
|
+
declare function SectionHeading({ children, size, as, align, subtitle, className, }: SectionHeadingProps): react_jsx_runtime.JSX.Element;
|
|
231
240
|
|
|
232
241
|
interface TicketButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
233
242
|
children: ReactNode;
|
package/dist/index.d.ts
CHANGED
|
@@ -203,9 +203,17 @@ declare function Skeleton({ variant, width, height, className }: SkeletonProps):
|
|
|
203
203
|
|
|
204
204
|
type HeadingTag = 'h1' | 'h2' | 'h3';
|
|
205
205
|
type HeadingAlign = 'left' | 'center';
|
|
206
|
+
type HeadingSize = 'sm' | 'md' | 'lg';
|
|
206
207
|
interface SectionHeadingProps {
|
|
207
208
|
children: ReactNode;
|
|
208
|
-
/**
|
|
209
|
+
/**
|
|
210
|
+
* Размер заголовка (responsive clamp).
|
|
211
|
+
* - `'sm'` — `clamp(1.125rem, 2.5vw, 1.375rem)` ≈ 18-22px. Sub-block heading, card group titles.
|
|
212
|
+
* - `'md'` (default) — `clamp(1.5rem, 3vw, 2rem)` ≈ 24-32px. Typical section h2 (industry-standard).
|
|
213
|
+
* - `'lg'` — `clamp(1.75rem, 4vw, 2.75rem)` ≈ 28-44px. Landing promo section (= PromoSplit/PromoTestimonials).
|
|
214
|
+
*/
|
|
215
|
+
size?: HeadingSize;
|
|
216
|
+
/** HTML-тег. Default `'h2'`. Не привязан к size — используй для семантики. */
|
|
209
217
|
as?: HeadingTag;
|
|
210
218
|
/** Выравнивание. Default `'left'`. */
|
|
211
219
|
align?: HeadingAlign;
|
|
@@ -214,20 +222,21 @@ interface SectionHeadingProps {
|
|
|
214
222
|
className?: string;
|
|
215
223
|
}
|
|
216
224
|
/**
|
|
217
|
-
* Единый source для section-
|
|
218
|
-
*
|
|
219
|
-
*
|
|
225
|
+
* Единый source типографики для section-headings во всём пакете и потребителях.
|
|
226
|
+
* Три размера:
|
|
227
|
+
* - `sm` (18-22px) — подсекции, group titles.
|
|
228
|
+
* - `md` (24-32px, default) — typical section h2 (industry-standard: shadcn / Tailwind UI / Linear).
|
|
229
|
+
* - `lg` (28-44px) — landing promo headings (идентично PromoSplit/PromoTestimonials).
|
|
220
230
|
*
|
|
221
|
-
*
|
|
222
|
-
* без встроенного title и вынужден захардкоживать ту же типографику в своём `.heading`
|
|
223
|
-
* — теперь импортирует `<SectionHeading>` и получает единый стиль автоматически.
|
|
231
|
+
* Прop `as` (h1/h2/h3) независим от `size` — используй для семантики:
|
|
224
232
|
*
|
|
225
233
|
* ```tsx
|
|
226
|
-
* <SectionHeading
|
|
227
|
-
* <
|
|
234
|
+
* <SectionHeading>Section h2 — default md size</SectionHeading>
|
|
235
|
+
* <SectionHeading size="lg" as="h1">Landing hero h1 — large</SectionHeading>
|
|
236
|
+
* <SectionHeading size="sm" as="h3">Subsection</SectionHeading>
|
|
228
237
|
* ```
|
|
229
238
|
*/
|
|
230
|
-
declare function SectionHeading({ children, as, align, subtitle, className, }: SectionHeadingProps): react_jsx_runtime.JSX.Element;
|
|
239
|
+
declare function SectionHeading({ children, size, as, align, subtitle, className, }: SectionHeadingProps): react_jsx_runtime.JSX.Element;
|
|
231
240
|
|
|
232
241
|
interface TicketButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
233
242
|
children: ReactNode;
|
package/dist/index.js
CHANGED
|
@@ -1684,10 +1684,9 @@ function Skeleton({ variant = "line", width, height, className = "" }) {
|
|
|
1684
1684
|
|
|
1685
1685
|
// css-inject-scss:/Users/dimakozh/Desktop/projects/kapustin.cc/packages/ui/src/atoms/SectionHeading.module.scss
|
|
1686
1686
|
__styleInject(`@charset "UTF-8";
|
|
1687
|
-
/* SectionHeading \u2014 \
|
|
1688
|
-
\
|
|
1687
|
+
/* SectionHeading \u2014 \u0442\u0438\u043F\u043E\u0433\u0440\u0430\u0444\u0438\u043A\u0430 \u0434\u043B\u044F section-headings.
|
|
1688
|
+
\u0422\u0440\u0438 \u0440\u0430\u0437\u043C\u0435\u0440\u0430: sm (sub-block), md (default, typical section h2), lg (landing promo). */
|
|
1689
1689
|
.SectionHeading-module_heading {
|
|
1690
|
-
font-size: clamp(1.75rem, 4vw, 2.75rem);
|
|
1691
1690
|
font-weight: 700;
|
|
1692
1691
|
line-height: 1.1;
|
|
1693
1692
|
letter-spacing: -0.03em;
|
|
@@ -1696,6 +1695,21 @@ __styleInject(`@charset "UTF-8";
|
|
|
1696
1695
|
margin: 0;
|
|
1697
1696
|
}
|
|
1698
1697
|
|
|
1698
|
+
/* \u2014 \u0420\u0430\u0437\u043C\u0435\u0440\u044B (responsive clamp) \u2014 */
|
|
1699
|
+
.SectionHeading-module_sizeSm {
|
|
1700
|
+
font-size: clamp(1.125rem, 2.5vw, 1.375rem);
|
|
1701
|
+
letter-spacing: -0.02em;
|
|
1702
|
+
}
|
|
1703
|
+
|
|
1704
|
+
.SectionHeading-module_sizeMd {
|
|
1705
|
+
font-size: clamp(1.5rem, 3vw, 2rem);
|
|
1706
|
+
}
|
|
1707
|
+
|
|
1708
|
+
.SectionHeading-module_sizeLg {
|
|
1709
|
+
font-size: clamp(1.75rem, 4vw, 2.75rem);
|
|
1710
|
+
}
|
|
1711
|
+
|
|
1712
|
+
/* \u2014 \u0412\u044B\u0440\u0430\u0432\u043D\u0438\u0432\u0430\u043D\u0438\u0435 \u2014 */
|
|
1699
1713
|
.SectionHeading-module_alignLeft {
|
|
1700
1714
|
text-align: left;
|
|
1701
1715
|
}
|
|
@@ -1704,6 +1718,7 @@ __styleInject(`@charset "UTF-8";
|
|
|
1704
1718
|
text-align: center;
|
|
1705
1719
|
}
|
|
1706
1720
|
|
|
1721
|
+
/* \u2014 Wrapper \u0434\u043B\u044F subtitle \u2014 */
|
|
1707
1722
|
.SectionHeading-module_wrap {
|
|
1708
1723
|
display: flex;
|
|
1709
1724
|
flex-direction: column;
|
|
@@ -1731,15 +1746,21 @@ __styleInject(`@charset "UTF-8";
|
|
|
1731
1746
|
font-size: 1.125rem;
|
|
1732
1747
|
}
|
|
1733
1748
|
}`);
|
|
1734
|
-
var __default20 = { "heading": "SectionHeading-module_heading", "alignLeft": "SectionHeading-module_alignLeft", "alignCenter": "SectionHeading-module_alignCenter", "wrap": "SectionHeading-module_wrap", "wrapCenter": "SectionHeading-module_wrapCenter", "subtitle": "SectionHeading-module_subtitle" };
|
|
1749
|
+
var __default20 = { "heading": "SectionHeading-module_heading", "sizeSm": "SectionHeading-module_sizeSm", "sizeMd": "SectionHeading-module_sizeMd", "sizeLg": "SectionHeading-module_sizeLg", "alignLeft": "SectionHeading-module_alignLeft", "alignCenter": "SectionHeading-module_alignCenter", "wrap": "SectionHeading-module_wrap", "wrapCenter": "SectionHeading-module_wrapCenter", "subtitle": "SectionHeading-module_subtitle" };
|
|
1750
|
+
var SIZE_CLASS = {
|
|
1751
|
+
sm: __default20.sizeSm,
|
|
1752
|
+
md: __default20.sizeMd,
|
|
1753
|
+
lg: __default20.sizeLg
|
|
1754
|
+
};
|
|
1735
1755
|
function SectionHeading({
|
|
1736
1756
|
children,
|
|
1757
|
+
size = "md",
|
|
1737
1758
|
as = "h2",
|
|
1738
1759
|
align = "left",
|
|
1739
1760
|
subtitle,
|
|
1740
1761
|
className = ""
|
|
1741
1762
|
}) {
|
|
1742
|
-
const headingClass = `${__default20.heading} ${align === "center" ? __default20.alignCenter : __default20.alignLeft}${className ? ` ${className}` : ""}`;
|
|
1763
|
+
const headingClass = `${__default20.heading} ${SIZE_CLASS[size]} ${align === "center" ? __default20.alignCenter : __default20.alignLeft}${className ? ` ${className}` : ""}`;
|
|
1743
1764
|
if (subtitle) {
|
|
1744
1765
|
return /* @__PURE__ */ jsxs("div", { className: align === "center" ? __default20.wrapCenter : __default20.wrap, children: [
|
|
1745
1766
|
createElement(as, { className: headingClass }, children),
|
package/package.json
CHANGED