@travel-match/ui 0.4.0 → 0.5.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/dist/components/AccountMenu/AccountMenu.cjs +1 -1
- package/dist/components/AccountMenu/AccountMenu.cjs.map +1 -1
- package/dist/components/AccountMenu/AccountMenu.js +1 -1
- package/dist/components/AccountMenu/AccountMenu.js.map +1 -1
- package/dist/components/ConfirmationDialog/ConfirmationDialog.cjs +1 -1
- package/dist/components/ConfirmationDialog/ConfirmationDialog.cjs.map +1 -1
- package/dist/components/ConfirmationDialog/ConfirmationDialog.js +1 -0
- package/dist/components/ConfirmationDialog/ConfirmationDialog.js.map +1 -1
- package/dist/components/CtaRequestFlow/CtaRequestFlow.cjs +1 -1
- package/dist/components/CtaRequestFlow/CtaRequestFlow.cjs.map +1 -1
- package/dist/components/CtaRequestFlow/CtaRequestFlow.js +72 -37
- package/dist/components/CtaRequestFlow/CtaRequestFlow.js.map +1 -1
- package/dist/components/ExampleRequests/ExampleRequests.cjs +1 -1
- package/dist/components/ExampleRequests/ExampleRequests.cjs.map +1 -1
- package/dist/components/ExampleRequests/ExampleRequests.js +18 -17
- package/dist/components/ExampleRequests/ExampleRequests.js.map +1 -1
- package/dist/components/FaqItem/FaqItem.cjs +1 -1
- package/dist/components/FaqItem/FaqItem.cjs.map +1 -1
- package/dist/components/FaqItem/FaqItem.js +79 -34
- package/dist/components/FaqItem/FaqItem.js.map +1 -1
- package/dist/components/Field/Field.cjs +1 -1
- package/dist/components/Field/Field.cjs.map +1 -1
- package/dist/components/Field/Field.js +10 -8
- package/dist/components/Field/Field.js.map +1 -1
- package/dist/components/InlineAlert/InlineAlert.cjs +1 -1
- package/dist/components/InlineAlert/InlineAlert.cjs.map +1 -1
- package/dist/components/InlineAlert/InlineAlert.js +9 -8
- package/dist/components/InlineAlert/InlineAlert.js.map +1 -1
- package/dist/components/NewRequestOverlay/NewRequestOverlay.cjs +1 -1
- package/dist/components/NewRequestOverlay/NewRequestOverlay.cjs.map +1 -1
- package/dist/components/NewRequestOverlay/NewRequestOverlay.js +67 -48
- package/dist/components/NewRequestOverlay/NewRequestOverlay.js.map +1 -1
- package/dist/components/NotificationsDropdown/NotificationsMenu.cjs +1 -1
- package/dist/components/NotificationsDropdown/NotificationsMenu.cjs.map +1 -1
- package/dist/components/NotificationsDropdown/NotificationsMenu.js +1 -1
- package/dist/components/NotificationsDropdown/NotificationsMenu.js.map +1 -1
- package/dist/components/PartnerCarousel/PartnerCarousel.cjs.map +1 -1
- package/dist/components/PartnerCarousel/PartnerCarousel.js.map +1 -1
- package/dist/components/PhoneInput/PhoneInput.cjs +1 -1
- package/dist/components/PhoneInput/PhoneInput.cjs.map +1 -1
- package/dist/components/PhoneInput/PhoneInput.js +8 -5
- package/dist/components/PhoneInput/PhoneInput.js.map +1 -1
- package/dist/components/PopularQuestions/PopularQuestions.cjs +1 -1
- package/dist/components/PopularQuestions/PopularQuestions.cjs.map +1 -1
- package/dist/components/PopularQuestions/PopularQuestions.js +22 -21
- package/dist/components/PopularQuestions/PopularQuestions.js.map +1 -1
- package/dist/components/RegionMap/RegionMap.cjs +2 -0
- package/dist/components/RegionMap/RegionMap.cjs.map +1 -0
- package/dist/components/RegionMap/RegionMap.js +55 -0
- package/dist/components/RegionMap/RegionMap.js.map +1 -0
- package/dist/components/RegionMap/mapPaths.cjs +2 -0
- package/dist/components/RegionMap/mapPaths.cjs.map +1 -0
- package/dist/components/RegionMap/mapPaths.js +86 -0
- package/dist/components/RegionMap/mapPaths.js.map +1 -0
- package/dist/components/RequestSearch/RequestSearch.cjs +2 -0
- package/dist/components/RequestSearch/RequestSearch.cjs.map +1 -0
- package/dist/components/RequestSearch/RequestSearch.js +36 -0
- package/dist/components/RequestSearch/RequestSearch.js.map +1 -0
- package/dist/components/RequestSummary/RequestSummary.cjs +1 -1
- package/dist/components/RequestSummary/RequestSummary.cjs.map +1 -1
- package/dist/components/RequestSummary/RequestSummary.js +31 -32
- package/dist/components/RequestSummary/RequestSummary.js.map +1 -1
- package/dist/components/RequestTypeOption/RequestTypeOption.cjs +2 -0
- package/dist/components/RequestTypeOption/RequestTypeOption.cjs.map +1 -0
- package/dist/components/RequestTypeOption/RequestTypeOption.js +52 -0
- package/dist/components/RequestTypeOption/RequestTypeOption.js.map +1 -0
- package/dist/components/Select/Select.cjs +1 -1
- package/dist/components/Select/Select.cjs.map +1 -1
- package/dist/components/Select/Select.js +127 -121
- package/dist/components/Select/Select.js.map +1 -1
- package/dist/components/ShowMore/ShowMore.cjs +2 -0
- package/dist/components/ShowMore/ShowMore.cjs.map +1 -0
- package/dist/components/ShowMore/ShowMore.js +34 -0
- package/dist/components/ShowMore/ShowMore.js.map +1 -0
- package/dist/components/SiteHeader/SiteHeader.cjs.map +1 -1
- package/dist/components/SiteHeader/SiteHeader.js.map +1 -1
- package/dist/components/SortSelect/SortSelect.cjs +2 -0
- package/dist/components/SortSelect/SortSelect.cjs.map +1 -0
- package/dist/components/SortSelect/SortSelect.js +18 -0
- package/dist/components/SortSelect/SortSelect.js.map +1 -0
- package/dist/components/StatusFilter/StatusFilter.cjs +2 -0
- package/dist/components/StatusFilter/StatusFilter.cjs.map +1 -0
- package/dist/components/StatusFilter/StatusFilter.js +37 -0
- package/dist/components/StatusFilter/StatusFilter.js.map +1 -0
- package/dist/components/StatusTag/StatusTag.cjs.map +1 -1
- package/dist/components/StatusTag/StatusTag.js.map +1 -1
- package/dist/components/StepCard/StepCard.cjs +1 -1
- package/dist/components/StepCard/StepCard.cjs.map +1 -1
- package/dist/components/StepCard/StepCard.js +9 -6
- package/dist/components/StepCard/StepCard.js.map +1 -1
- package/dist/components/StepProgress/StepProgress.cjs +2 -0
- package/dist/components/StepProgress/StepProgress.cjs.map +1 -0
- package/dist/components/StepProgress/StepProgress.js +43 -0
- package/dist/components/StepProgress/StepProgress.js.map +1 -0
- package/dist/components/TelegramConnect/TelegramConnect.cjs +2 -0
- package/dist/components/TelegramConnect/TelegramConnect.cjs.map +1 -0
- package/dist/components/TelegramConnect/TelegramConnect.js +57 -0
- package/dist/components/TelegramConnect/TelegramConnect.js.map +1 -0
- package/dist/components/TextInput/TextInput.cjs +1 -1
- package/dist/components/TextInput/TextInput.cjs.map +1 -1
- package/dist/components/TextInput/TextInput.js +21 -19
- package/dist/components/TextInput/TextInput.js.map +1 -1
- package/dist/components/Textarea/Textarea.cjs +1 -1
- package/dist/components/Textarea/Textarea.cjs.map +1 -1
- package/dist/components/Textarea/Textarea.js +18 -16
- package/dist/components/Textarea/Textarea.js.map +1 -1
- package/dist/components/Toast/Toast.cjs +2 -0
- package/dist/components/Toast/Toast.cjs.map +1 -0
- package/dist/components/Toast/Toast.js +57 -0
- package/dist/components/Toast/Toast.js.map +1 -0
- package/dist/icons/generated/CheckmarkIcon.cjs +1 -1
- package/dist/icons/generated/CheckmarkIcon.cjs.map +1 -1
- package/dist/icons/generated/CheckmarkIcon.js +19 -2
- package/dist/icons/generated/CheckmarkIcon.js.map +1 -1
- package/dist/icons/generated/InfoIcon.cjs +2 -0
- package/dist/icons/generated/InfoIcon.cjs.map +1 -0
- package/dist/icons/generated/InfoIcon.js +35 -0
- package/dist/icons/generated/InfoIcon.js.map +1 -0
- package/dist/icons/generated/SendIcon.cjs +2 -0
- package/dist/icons/generated/SendIcon.cjs.map +1 -0
- package/dist/icons/generated/SendIcon.js +23 -0
- package/dist/icons/generated/SendIcon.js.map +1 -0
- package/dist/icons/generated/index.cjs +1 -1
- package/dist/icons/generated/index.cjs.map +1 -1
- package/dist/icons/generated/index.js +71 -67
- package/dist/icons/generated/index.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +618 -32
- package/dist/index.d.ts +618 -32
- package/dist/index.js +146 -135
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +0 -6
- package/dist/tokens/generated.cjs +1 -1
- package/dist/tokens/generated.cjs.map +1 -1
- package/dist/tokens/generated.js +1 -7
- package/dist/tokens/generated.js.map +1 -1
- package/dist/tokens.css +0 -12
- package/dist/tokens.d.cts +2 -26
- package/dist/tokens.d.ts +2 -26
- package/dist/tokens.json +1 -7
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SiteHeader.cjs","names":["useState","PortalHeader","cn","PortalHeaderShow","require_cn","require_PortalHeader","react","react_jsx_runtime","SiteHeader","props","scrolled","setScrolled","watchScroll","solidOnScroll","variant","frame","update","scrollThreshold","onScroll","look","className","sticky","actions"],"sources":["../../../src/components/SiteHeader/SiteHeader.tsx"],"sourcesContent":["import { forwardRef, useEffect, useState, type ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\nimport { PortalHeader, PortalHeaderShow, type PortalHeaderProps } from '../PortalHeader';\nimport './SiteHeader.css';\n\n/** Figma \"Property 1\": `transparent` has no fill (over the home page hero), `solid` sits on `background/main`. */\nexport type SiteHeaderVariant = 'transparent' | 'solid';\n\nexport interface SiteHeaderProps extends Omit<PortalHeaderProps, 'actions'> {\n /** Figma \"Property 1\". `transparent` is for the top of a page whose hero runs under the header. */\n variant?: SiteHeaderVariant;\n /** Opt-in (not in the Figma prototype): a `transparent` header turns `solid` once the page has scrolled past `scrollThreshold`. */\n solidOnScroll?: boolean;\n /** Scroll distance in px after which `solidOnScroll` switches to the solid look. */\n scrollThreshold?: number;\n /** Keeps the header at the top of the viewport while the page scrolls (Figma: the header is a fixed child of every page frame). */\n sticky?: boolean;\n /**\n * Right side of the wide bar: `LanguageSelect` (size `sm`), \"Sign in\" (`Button variant=\"ghost\" size=\"sm\"`) and the call to action\n * (`Button size=\"sm\"`). Shown in the wide layout only — on small screens put them in `menu` / `menuFooter`, as Figma's \"Header / Mobile\" does.\n */\n actions?: ReactNode;\n}\n\n/**\n * Figma \"Header\" (Public Website, node 135:2790) and, below `collapseBelow`, \"Header / Mobile\" (node 2422:9625).\n * The marketing header has the anatomy of `PortalHeader` — logo, `HeaderItem` navigation, actions, and on small screens a menu button\n * opening a full-screen menu — so it is a `PortalHeader` with the public website's look. All of PortalHeader's behaviour\n * (container-query collapse, disclosure button with `aria-expanded`, Escape and focus return, closing on link click) is inherited.\n */\nexport const SiteHeader = /* @__PURE__ */ forwardRef<HTMLElement, SiteHeaderProps>(function SiteHeader(\n { variant = 'solid', solidOnScroll = false, scrollThreshold = 8, sticky = false, actions, className, ...props },\n ref,\n) {\n const [scrolled, setScrolled] = useState(false);\n const watchScroll = solidOnScroll && variant === 'transparent';\n\n useEffect(() => {\n if (!watchScroll) return;\n let frame = 0;\n const update = () => {\n frame = 0;\n setScrolled(window.scrollY > scrollThreshold);\n };\n const onScroll = () => {\n if (!frame) frame = window.requestAnimationFrame(update);\n };\n update();\n window.addEventListener('scroll', onScroll, { passive: true });\n return () => {\n window.removeEventListener('scroll', onScroll);\n if (frame) window.cancelAnimationFrame(frame);\n };\n }, [watchScroll, scrollThreshold]);\n\n const look = variant === 'transparent' && !(watchScroll && scrolled) ? 'transparent' : 'solid';\n\n return (\n <PortalHeader\n ref={ref}\n className={cn('tm-site-header', className)}\n data-variant={look}\n data-sticky={sticky ? '' : undefined}\n actions={actions ? <PortalHeaderShow on=\"wide\">{actions}</PortalHeaderShow> : undefined}\n {...props}\n />\n );\n});\n"],"mappings":"A,
|
|
1
|
+
{"version":3,"file":"SiteHeader.cjs","names":["useState","PortalHeader","cn","PortalHeaderShow","require_cn","require_PortalHeader","react","react_jsx_runtime","SiteHeader","props","scrolled","setScrolled","watchScroll","solidOnScroll","variant","frame","update","scrollThreshold","onScroll","look","className","sticky","actions"],"sources":["../../../src/components/SiteHeader/SiteHeader.tsx"],"sourcesContent":["import { forwardRef, useEffect, useState, type ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\nimport { PortalHeader, PortalHeaderShow, type PortalHeaderProps } from '../PortalHeader';\nimport './SiteHeader.css';\n\n/** Figma \"Property 1\": `transparent` has no fill (over the home page hero), `solid` sits on `background/main`. */\nexport type SiteHeaderVariant = 'transparent' | 'solid';\n\nexport interface SiteHeaderProps extends Omit<PortalHeaderProps, 'actions'> {\n /** Figma \"Property 1\". `transparent` is for the top of a page whose hero runs under the header. */\n variant?: SiteHeaderVariant;\n /** Opt-in (not in the Figma prototype): a `transparent` header turns `solid` once the page has scrolled past `scrollThreshold`. */\n solidOnScroll?: boolean;\n /** Scroll distance in px after which `solidOnScroll` switches to the solid look. */\n scrollThreshold?: number;\n /** Keeps the header at the top of the viewport while the page scrolls (Figma: the header is a fixed child of every page frame). */\n sticky?: boolean;\n /**\n * Right side of the wide bar: `LanguageSelect` (size `sm`), \"Sign in\" (`Button variant=\"ghost\" size=\"sm\"`) and the call to action\n * (`Button size=\"sm\"`). Shown in the wide layout only — on small screens put them in `menu` / `menuFooter`, as Figma's \"Header / Mobile\" does.\n */\n actions?: ReactNode;\n}\n\n/**\n * Figma \"Header\" (Public Website, node 135:2790) and, below `collapseBelow`, \"Header / Mobile\" (node 2422:9625).\n * The marketing header has the anatomy of `PortalHeader` — logo, `HeaderItem` navigation, actions, and on small screens a menu button\n * opening a full-screen menu — so it is a `PortalHeader` with the public website's look. All of PortalHeader's behaviour\n * (container-query collapse, disclosure button with `aria-expanded`, Escape and focus return, closing on link click) is inherited.\n * The closed solid bar is coloured by the public custom property `--tm-site-header-bg` (default `background/main`); set it on the\n * header (or an ancestor) for pages whose Figma header takes the page colour. The open small-screen menu stays `background/main`.\n */\nexport const SiteHeader = /* @__PURE__ */ forwardRef<HTMLElement, SiteHeaderProps>(function SiteHeader(\n { variant = 'solid', solidOnScroll = false, scrollThreshold = 8, sticky = false, actions, className, ...props },\n ref,\n) {\n const [scrolled, setScrolled] = useState(false);\n const watchScroll = solidOnScroll && variant === 'transparent';\n\n useEffect(() => {\n if (!watchScroll) return;\n let frame = 0;\n const update = () => {\n frame = 0;\n setScrolled(window.scrollY > scrollThreshold);\n };\n const onScroll = () => {\n if (!frame) frame = window.requestAnimationFrame(update);\n };\n update();\n window.addEventListener('scroll', onScroll, { passive: true });\n return () => {\n window.removeEventListener('scroll', onScroll);\n if (frame) window.cancelAnimationFrame(frame);\n };\n }, [watchScroll, scrollThreshold]);\n\n const look = variant === 'transparent' && !(watchScroll && scrolled) ? 'transparent' : 'solid';\n\n return (\n <PortalHeader\n ref={ref}\n className={cn('tm-site-header', className)}\n data-variant={look}\n data-sticky={sticky ? '' : undefined}\n actions={actions ? <PortalHeaderShow on=\"wide\">{actions}</PortalHeaderShow> : undefined}\n {...props}\n />\n );\n});\n"],"mappings":"A,uLAgCA,IAAaQ,GAA6B,EAAAF,EAAA,WAAA,CAAyC,SACjF,CAAE,UAAU,QAAS,gBAAgB,GAAO,kBAAkB,EAAG,SAAS,GAAO,UAAS,YAAW,GAAGG,GACxG,EACA,CACA,GAAM,CAACC,EAAUC,IAAA,EAAeX,EAAAA,SAAAA,CAAS,EAAK,EACxCY,EAAcC,GAAiBC,IAAY,eAEjD,EAAAR,EAAA,UAAA,KAAgB,CACd,GAAI,CAACM,EAAa,OAClB,IAAIG,EAAQ,EACNC,MAAe,CACnB,EAAQ,EACRL,EAAY,OAAO,QAAUM,CAAe,CAC9C,EACMC,MAAiB,CAChBH,IAAO,EAAQ,OAAO,sBAAsBC,CAAM,EACzD,EAGA,OAFAA,EAAO,EACP,OAAO,iBAAiB,SAAUE,EAAU,CAAE,QAAS,EAAK,CAAC,MAChD,CACX,OAAO,oBAAoB,SAAUA,CAAQ,EACzCH,GAAO,OAAO,qBAAqBA,CAAK,CAC9C,CACF,EAAG,CAACH,EAAaK,CAAe,CAAC,EAEjC,IAAME,EAAOL,IAAY,eAAiB,EAAEF,GAAeF,GAAY,cAAgB,QAEvF,OACE,EAAAH,EAAA,IAAA,CAACN,EAAAA,aAAD,CACO,MACL,UAAWC,EAAAA,GAAG,iBAAkBkB,CAAS,EACzC,eAAcD,EACd,cAAaE,EAAS,GAAK,IAAA,GAC3B,QAASC,GAAU,EAAAf,EAAA,IAAA,CAACJ,EAAAA,iBAAD,CAAkB,GAAG,OAAQ,SAAAmB,CAA0B,CAAA,EAAI,IAAA,GAC9E,GAAIb,CACL,CAAA,CAEL,CAAC,E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SiteHeader.js","names":["SiteHeader","props","scrolled","setScrolled","useState","watchScroll","solidOnScroll","variant","frame","update","scrollThreshold","onScroll","look","PortalHeader","cn","className","sticky","actions","PortalHeaderShow"],"sources":["../../../src/components/SiteHeader/SiteHeader.tsx"],"sourcesContent":["import { forwardRef, useEffect, useState, type ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\nimport { PortalHeader, PortalHeaderShow, type PortalHeaderProps } from '../PortalHeader';\nimport './SiteHeader.css';\n\n/** Figma \"Property 1\": `transparent` has no fill (over the home page hero), `solid` sits on `background/main`. */\nexport type SiteHeaderVariant = 'transparent' | 'solid';\n\nexport interface SiteHeaderProps extends Omit<PortalHeaderProps, 'actions'> {\n /** Figma \"Property 1\". `transparent` is for the top of a page whose hero runs under the header. */\n variant?: SiteHeaderVariant;\n /** Opt-in (not in the Figma prototype): a `transparent` header turns `solid` once the page has scrolled past `scrollThreshold`. */\n solidOnScroll?: boolean;\n /** Scroll distance in px after which `solidOnScroll` switches to the solid look. */\n scrollThreshold?: number;\n /** Keeps the header at the top of the viewport while the page scrolls (Figma: the header is a fixed child of every page frame). */\n sticky?: boolean;\n /**\n * Right side of the wide bar: `LanguageSelect` (size `sm`), \"Sign in\" (`Button variant=\"ghost\" size=\"sm\"`) and the call to action\n * (`Button size=\"sm\"`). Shown in the wide layout only — on small screens put them in `menu` / `menuFooter`, as Figma's \"Header / Mobile\" does.\n */\n actions?: ReactNode;\n}\n\n/**\n * Figma \"Header\" (Public Website, node 135:2790) and, below `collapseBelow`, \"Header / Mobile\" (node 2422:9625).\n * The marketing header has the anatomy of `PortalHeader` — logo, `HeaderItem` navigation, actions, and on small screens a menu button\n * opening a full-screen menu — so it is a `PortalHeader` with the public website's look. All of PortalHeader's behaviour\n * (container-query collapse, disclosure button with `aria-expanded`, Escape and focus return, closing on link click) is inherited.\n */\nexport const SiteHeader = /* @__PURE__ */ forwardRef<HTMLElement, SiteHeaderProps>(function SiteHeader(\n { variant = 'solid', solidOnScroll = false, scrollThreshold = 8, sticky = false, actions, className, ...props },\n ref,\n) {\n const [scrolled, setScrolled] = useState(false);\n const watchScroll = solidOnScroll && variant === 'transparent';\n\n useEffect(() => {\n if (!watchScroll) return;\n let frame = 0;\n const update = () => {\n frame = 0;\n setScrolled(window.scrollY > scrollThreshold);\n };\n const onScroll = () => {\n if (!frame) frame = window.requestAnimationFrame(update);\n };\n update();\n window.addEventListener('scroll', onScroll, { passive: true });\n return () => {\n window.removeEventListener('scroll', onScroll);\n if (frame) window.cancelAnimationFrame(frame);\n };\n }, [watchScroll, scrollThreshold]);\n\n const look = variant === 'transparent' && !(watchScroll && scrolled) ? 'transparent' : 'solid';\n\n return (\n <PortalHeader\n ref={ref}\n className={cn('tm-site-header', className)}\n data-variant={look}\n data-sticky={sticky ? '' : undefined}\n actions={actions ? <PortalHeaderShow on=\"wide\">{actions}</PortalHeaderShow> : undefined}\n {...props}\n />\n );\n});\n"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"SiteHeader.js","names":["SiteHeader","props","scrolled","setScrolled","useState","watchScroll","solidOnScroll","variant","frame","update","scrollThreshold","onScroll","look","PortalHeader","cn","className","sticky","actions","PortalHeaderShow"],"sources":["../../../src/components/SiteHeader/SiteHeader.tsx"],"sourcesContent":["import { forwardRef, useEffect, useState, type ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\nimport { PortalHeader, PortalHeaderShow, type PortalHeaderProps } from '../PortalHeader';\nimport './SiteHeader.css';\n\n/** Figma \"Property 1\": `transparent` has no fill (over the home page hero), `solid` sits on `background/main`. */\nexport type SiteHeaderVariant = 'transparent' | 'solid';\n\nexport interface SiteHeaderProps extends Omit<PortalHeaderProps, 'actions'> {\n /** Figma \"Property 1\". `transparent` is for the top of a page whose hero runs under the header. */\n variant?: SiteHeaderVariant;\n /** Opt-in (not in the Figma prototype): a `transparent` header turns `solid` once the page has scrolled past `scrollThreshold`. */\n solidOnScroll?: boolean;\n /** Scroll distance in px after which `solidOnScroll` switches to the solid look. */\n scrollThreshold?: number;\n /** Keeps the header at the top of the viewport while the page scrolls (Figma: the header is a fixed child of every page frame). */\n sticky?: boolean;\n /**\n * Right side of the wide bar: `LanguageSelect` (size `sm`), \"Sign in\" (`Button variant=\"ghost\" size=\"sm\"`) and the call to action\n * (`Button size=\"sm\"`). Shown in the wide layout only — on small screens put them in `menu` / `menuFooter`, as Figma's \"Header / Mobile\" does.\n */\n actions?: ReactNode;\n}\n\n/**\n * Figma \"Header\" (Public Website, node 135:2790) and, below `collapseBelow`, \"Header / Mobile\" (node 2422:9625).\n * The marketing header has the anatomy of `PortalHeader` — logo, `HeaderItem` navigation, actions, and on small screens a menu button\n * opening a full-screen menu — so it is a `PortalHeader` with the public website's look. All of PortalHeader's behaviour\n * (container-query collapse, disclosure button with `aria-expanded`, Escape and focus return, closing on link click) is inherited.\n * The closed solid bar is coloured by the public custom property `--tm-site-header-bg` (default `background/main`); set it on the\n * header (or an ancestor) for pages whose Figma header takes the page colour. The open small-screen menu stays `background/main`.\n */\nexport const SiteHeader = /* @__PURE__ */ forwardRef<HTMLElement, SiteHeaderProps>(function SiteHeader(\n { variant = 'solid', solidOnScroll = false, scrollThreshold = 8, sticky = false, actions, className, ...props },\n ref,\n) {\n const [scrolled, setScrolled] = useState(false);\n const watchScroll = solidOnScroll && variant === 'transparent';\n\n useEffect(() => {\n if (!watchScroll) return;\n let frame = 0;\n const update = () => {\n frame = 0;\n setScrolled(window.scrollY > scrollThreshold);\n };\n const onScroll = () => {\n if (!frame) frame = window.requestAnimationFrame(update);\n };\n update();\n window.addEventListener('scroll', onScroll, { passive: true });\n return () => {\n window.removeEventListener('scroll', onScroll);\n if (frame) window.cancelAnimationFrame(frame);\n };\n }, [watchScroll, scrollThreshold]);\n\n const look = variant === 'transparent' && !(watchScroll && scrolled) ? 'transparent' : 'solid';\n\n return (\n <PortalHeader\n ref={ref}\n className={cn('tm-site-header', className)}\n data-variant={look}\n data-sticky={sticky ? '' : undefined}\n actions={actions ? <PortalHeaderShow on=\"wide\">{actions}</PortalHeaderShow> : undefined}\n {...props}\n />\n );\n});\n"],"mappings":";;;;;;;AAgCA,IAAaA,IAA6B,kBAAyC,SACjF,EAAE,aAAU,SAAS,mBAAgB,IAAO,qBAAkB,GAAG,YAAS,IAAO,YAAS,cAAW,GAAGC,KACxG,GACA;CACA,IAAM,CAACC,GAAUC,KAAeC,EAAS,EAAK,GACxCC,IAAcC,KAAiBC,MAAY;CAEjD,QAAgB;EACd,IAAI,CAACF,GAAa;EAClB,IAAIG,IAAQ,GACNC,UAAe;GAEnB,AADA,IAAQ,GACRN,EAAY,OAAO,UAAUO,CAAe;EAC9C,GACMC,UAAiB;GACrB,AAAKH,MAAO,IAAQ,OAAO,sBAAsBC,CAAM;EACzD;EAGA,OAFAA,EAAO,GACP,OAAO,iBAAiB,UAAUE,GAAU,EAAE,SAAS,GAAK,CAAC,SAChD;GAEX,AADA,OAAO,oBAAoB,UAAUA,CAAQ,GACzCH,KAAO,OAAO,qBAAqBA,CAAK;EAC9C;CACF,GAAG,CAACH,GAAaK,CAAe,CAAC;CAEjC,IAAME,IAAOL,MAAY,iBAAiB,EAAEF,KAAeH,KAAY,gBAAgB;CAEvF,OACE,kBAACW,GAAD;EACO;EACL,WAAWC,EAAG,kBAAkBC,CAAS;EACzC,gBAAcH;EACd,eAAaI,IAAS,KAAK,KAAA;EAC3B,SAASC,IAAU,kBAACC,GAAD;GAAkB,IAAG;GAAQ,UAAAD;EAA0B,CAAA,IAAI,KAAA;EAC9E,GAAIhB;CACL,CAAA;AAEL,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";const e=require("../../utils/cn.cjs"),t=require("../Select/Select.cjs");;/* empty css */let n=require("react"),r=require("react/jsx-runtime");var i=(0,n.forwardRef)(function({className:n,...i},a){return(0,r.jsx)(t.Select,{ref:a,...i,className:e.cn(`tm-sort-select`,n),size:`md`})});exports.SortSelect=i;
|
|
2
|
+
//# sourceMappingURL=SortSelect.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SortSelect.cjs","names":["Select","cn","require_cn","require_Select","react","react_jsx_runtime","SortSelect","props","className"],"sources":["../../../src/components/SortSelect/SortSelect.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { cn } from '../../utils/cn';\nimport { Select, type SelectSingleProps } from '../Select';\nimport './SortSelect.css';\n\nexport type SortSelectProps = Omit<SelectSingleProps, 'multiple' | 'size'>;\n\n/**\n * Figma component set \"Sort select\" (2707:12169): the sort-order dropdown of the My Requests toolbar —\n * a 180px Drop down input (Type=Select, Size M) that always has a value (Newest first, Oldest first, …).\n * Without a visible label, give it an `aria-label`.\n */\nexport const SortSelect = /* @__PURE__ */ forwardRef<HTMLButtonElement, SortSelectProps>(function SortSelect({ className, ...props }, ref) {\n return <Select ref={ref} {...props} className={cn('tm-sort-select', className)} size=\"md\" />;\n});\n"],"mappings":"A,2KAYA,IAAaM,GAA6B,EAAAF,EAAA,WAAA,CAA+C,SAAoB,CAAE,YAAW,GAAGG,GAAS,EAAK,CACzI,OAAO,EAAAF,EAAA,IAAA,CAACL,EAAAA,OAAD,CAAa,MAAK,GAAIO,EAAO,UAAWN,EAAAA,GAAG,iBAAkBO,CAAS,EAAG,KAAK,IAAM,CAAA,CAC7F,CAAC,E"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../utils/cn.js";
|
|
3
|
+
import { Select as t } from "../Select/Select.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
import { forwardRef as n } from "react";
|
|
6
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
7
|
+
// src/components/SortSelect/SortSelect.tsx
|
|
8
|
+
var i = /* @__PURE__ */ n(function({ className: n, ...i }, a) {
|
|
9
|
+
return /* @__PURE__ */ r(t, {
|
|
10
|
+
ref: a,
|
|
11
|
+
...i,
|
|
12
|
+
className: e("tm-sort-select", n),
|
|
13
|
+
size: "md"
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
export { i as SortSelect };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=SortSelect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SortSelect.js","names":["SortSelect","props","Select","cn","className"],"sources":["../../../src/components/SortSelect/SortSelect.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { cn } from '../../utils/cn';\nimport { Select, type SelectSingleProps } from '../Select';\nimport './SortSelect.css';\n\nexport type SortSelectProps = Omit<SelectSingleProps, 'multiple' | 'size'>;\n\n/**\n * Figma component set \"Sort select\" (2707:12169): the sort-order dropdown of the My Requests toolbar —\n * a 180px Drop down input (Type=Select, Size M) that always has a value (Newest first, Oldest first, …).\n * Without a visible label, give it an `aria-label`.\n */\nexport const SortSelect = /* @__PURE__ */ forwardRef<HTMLButtonElement, SortSelectProps>(function SortSelect({ className, ...props }, ref) {\n return <Select ref={ref} {...props} className={cn('tm-sort-select', className)} size=\"md\" />;\n});\n"],"mappings":";;;;;;;AAYA,IAAaA,IAA6B,kBAA+C,SAAoB,EAAE,cAAW,GAAGC,KAAS,GAAK;CACzI,OAAO,kBAACC,GAAD;EAAa;EAAK,GAAID;EAAO,WAAWE,EAAG,kBAAkBC,CAAS;EAAG,MAAK;CAAM,CAAA;AAC7F,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";const e=require("../../utils/cn.cjs"),t=require("../Select/Select.cjs");;/* empty css */let n=require("react"),r=require("react/jsx-runtime");var i=`__tm-all__`,a=(0,n.forwardRef)(function({options:a,allLabel:o=`All statuses`,value:s,defaultValue:c=null,onValueChange:l,className:u,...d},f){let[p,m]=(0,n.useState)(c),h=s===void 0?p:s,g=typeof o==`string`?o:`All statuses`,_=(0,n.useMemo)(()=>[{value:i,label:o,textValue:g},...a],[o,g,a]);return(0,r.jsx)(t.Select,{ref:f,...d,className:e.cn(`tm-status-filter`,u),size:`md`,options:_,value:h??i,onValueChange:e=>{let t=e===i?null:e;s===void 0&&m(t),l?.(t)},renderValue:e=>e.value===i?(0,r.jsx)(`span`,{className:`tm-status-filter__all`,children:e.label}):e.label})});exports.StatusFilter=a;
|
|
2
|
+
//# sourceMappingURL=StatusFilter.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatusFilter.cjs","names":["useState","useMemo","Select","cn","require_cn","require_Select","react","react_jsx_runtime","ALL","StatusFilter","props","internal","setInternal","defaultValue","current","value","allText","allLabel","allOptions","options","className","resolved","next","onValueChange","option"],"sources":["../../../src/components/StatusFilter/StatusFilter.tsx"],"sourcesContent":["import { forwardRef, useMemo, useState, type ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\nimport { Select, type SelectOption, type SelectSingleProps } from '../Select';\nimport './StatusFilter.css';\n\n/** Internal value of the \"All statuses\" row; never reaches the app, which gets `null` instead. */\nconst ALL = '__tm-all__';\n\nexport interface StatusFilterProps\n // `name` is left out: a filter is page state, not a form field (the \"All\" row would otherwise submit an internal value).\n extends Omit<SelectSingleProps, 'multiple' | 'value' | 'defaultValue' | 'onValueChange' | 'options' | 'placeholder' | 'size' | 'name'> {\n /** The statuses to filter by, in display order (Figma: Under Review, Needs Clarification, Waiting for Offers, …). */\n options: SelectOption[];\n /** Text of the \"no filter\" row, shown in the field while no status is chosen — translate it. */\n allLabel?: ReactNode;\n /** Chosen status (controlled); `null` for all statuses. */\n value?: string | null;\n /** Initially chosen status (uncontrolled); `null` (default) for all. */\n defaultValue?: string | null;\n /** Called with the chosen status, or `null` when \"All statuses\" is picked. */\n onValueChange?: (value: string | null) => void;\n}\n\n/**\n * Figma component set \"Status filter\" (2707:12045): the status dropdown of the My Requests toolbar —\n * a 220px Drop down input (Type=Select, Size M) whose first row, \"All statuses\", clears the filter.\n * Without a visible label, give it an `aria-label`.\n */\nexport const StatusFilter = /* @__PURE__ */ forwardRef<HTMLButtonElement, StatusFilterProps>(function StatusFilter(\n { options, allLabel = 'All statuses', value, defaultValue = null, onValueChange, className, ...props },\n ref,\n) {\n const [internal, setInternal] = useState<string | null>(defaultValue);\n const current = value === undefined ? internal : value;\n const allText = typeof allLabel === 'string' ? allLabel : 'All statuses';\n const allOptions = useMemo<SelectOption[]>(() => [{ value: ALL, label: allLabel, textValue: allText }, ...options], [allLabel, allText, options]);\n\n return (\n <Select\n ref={ref}\n {...props}\n className={cn('tm-status-filter', className)}\n size=\"md\"\n options={allOptions}\n value={current ?? ALL}\n onValueChange={(next) => {\n const resolved = next === ALL ? null : next;\n if (value === undefined) setInternal(resolved);\n onValueChange?.(resolved);\n }}\n // Figma shows \"All statuses\" in the placeholder colour (text/tertiary), a chosen status in text/primary.\n renderValue={(option) => (option.value === ALL ? <span className=\"tm-status-filter__all\">{option.label}</span> : option.label)}\n />\n );\n});\n"],"mappings":"A,6KAMA,IAAMQ,EAAM,aAsBCC,GAA+B,EAAAH,EAAA,WAAA,CAAiD,SAC3F,CAAE,UAAS,WAAW,eAAgB,QAAO,eAAe,KAAM,gBAAe,YAAW,GAAGI,GAC/F,EACA,CACA,GAAM,CAACC,EAAUC,IAAA,EAAeZ,EAAAA,SAAAA,CAAwBa,CAAY,EAC9DC,EAAUC,IAAU,IAAA,GAAYJ,EAAWI,EAC3CC,EAAU,OAAOC,GAAa,SAAWA,EAAW,eACpDC,GAAA,EAAajB,EAAAA,QAAAA,KAA8B,CAAC,CAAE,MAAOO,EAAK,MAAOS,EAAU,UAAWD,CAAQ,EAAG,GAAGG,CAAO,EAAG,CAACF,EAAUD,EAASG,CAAO,CAAC,EAEhJ,OACE,EAAAZ,EAAA,IAAA,CAACL,EAAAA,OAAD,CACO,MACL,GAAIQ,EACJ,UAAWP,EAAAA,GAAG,mBAAoBiB,CAAS,EAC3C,KAAK,KACL,QAASF,EACT,MAAOJ,GAAWN,EAClB,cAAgB,GAAS,CACvB,IAAMa,EAAWC,IAASd,EAAM,KAAOc,EACnCP,IAAU,IAAA,IAAWH,EAAYS,CAAQ,EAC7CE,IAAgBF,CAAQ,CAC1B,EAEA,YAAc,GAAYG,EAAO,QAAUhB,GAAM,EAAAD,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,wBAAyB,SAAAiB,EAAO,KAAY,CAAA,EAAIA,EAAO,KACzH,CAAA,CAEL,CAAC,E"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../utils/cn.js";
|
|
3
|
+
import { Select as t } from "../Select/Select.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
import { forwardRef as n, useMemo as r, useState as i } from "react";
|
|
6
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
7
|
+
// src/components/StatusFilter/StatusFilter.tsx
|
|
8
|
+
var o = "__tm-all__", s = /* @__PURE__ */ n(function({ options: n, allLabel: s = "All statuses", value: c, defaultValue: l = null, onValueChange: u, className: d, ...f }, p) {
|
|
9
|
+
let [m, h] = i(l), g = c === void 0 ? m : c, _ = typeof s == "string" ? s : "All statuses", v = r(() => [{
|
|
10
|
+
value: o,
|
|
11
|
+
label: s,
|
|
12
|
+
textValue: _
|
|
13
|
+
}, ...n], [
|
|
14
|
+
s,
|
|
15
|
+
_,
|
|
16
|
+
n
|
|
17
|
+
]);
|
|
18
|
+
return /* @__PURE__ */ a(t, {
|
|
19
|
+
ref: p,
|
|
20
|
+
...f,
|
|
21
|
+
className: e("tm-status-filter", d),
|
|
22
|
+
size: "md",
|
|
23
|
+
options: v,
|
|
24
|
+
value: g ?? o,
|
|
25
|
+
onValueChange: (e) => {
|
|
26
|
+
let t = e === o ? null : e;
|
|
27
|
+
c === void 0 && h(t), u?.(t);
|
|
28
|
+
},
|
|
29
|
+
renderValue: (e) => e.value === o ? /* @__PURE__ */ a("span", {
|
|
30
|
+
className: "tm-status-filter__all",
|
|
31
|
+
children: e.label
|
|
32
|
+
}) : e.label
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
export { s as StatusFilter };
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=StatusFilter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatusFilter.js","names":["ALL","StatusFilter","props","internal","setInternal","useState","defaultValue","current","value","allText","allLabel","allOptions","useMemo","options","Select","cn","className","resolved","next","onValueChange","option"],"sources":["../../../src/components/StatusFilter/StatusFilter.tsx"],"sourcesContent":["import { forwardRef, useMemo, useState, type ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\nimport { Select, type SelectOption, type SelectSingleProps } from '../Select';\nimport './StatusFilter.css';\n\n/** Internal value of the \"All statuses\" row; never reaches the app, which gets `null` instead. */\nconst ALL = '__tm-all__';\n\nexport interface StatusFilterProps\n // `name` is left out: a filter is page state, not a form field (the \"All\" row would otherwise submit an internal value).\n extends Omit<SelectSingleProps, 'multiple' | 'value' | 'defaultValue' | 'onValueChange' | 'options' | 'placeholder' | 'size' | 'name'> {\n /** The statuses to filter by, in display order (Figma: Under Review, Needs Clarification, Waiting for Offers, …). */\n options: SelectOption[];\n /** Text of the \"no filter\" row, shown in the field while no status is chosen — translate it. */\n allLabel?: ReactNode;\n /** Chosen status (controlled); `null` for all statuses. */\n value?: string | null;\n /** Initially chosen status (uncontrolled); `null` (default) for all. */\n defaultValue?: string | null;\n /** Called with the chosen status, or `null` when \"All statuses\" is picked. */\n onValueChange?: (value: string | null) => void;\n}\n\n/**\n * Figma component set \"Status filter\" (2707:12045): the status dropdown of the My Requests toolbar —\n * a 220px Drop down input (Type=Select, Size M) whose first row, \"All statuses\", clears the filter.\n * Without a visible label, give it an `aria-label`.\n */\nexport const StatusFilter = /* @__PURE__ */ forwardRef<HTMLButtonElement, StatusFilterProps>(function StatusFilter(\n { options, allLabel = 'All statuses', value, defaultValue = null, onValueChange, className, ...props },\n ref,\n) {\n const [internal, setInternal] = useState<string | null>(defaultValue);\n const current = value === undefined ? internal : value;\n const allText = typeof allLabel === 'string' ? allLabel : 'All statuses';\n const allOptions = useMemo<SelectOption[]>(() => [{ value: ALL, label: allLabel, textValue: allText }, ...options], [allLabel, allText, options]);\n\n return (\n <Select\n ref={ref}\n {...props}\n className={cn('tm-status-filter', className)}\n size=\"md\"\n options={allOptions}\n value={current ?? ALL}\n onValueChange={(next) => {\n const resolved = next === ALL ? null : next;\n if (value === undefined) setInternal(resolved);\n onValueChange?.(resolved);\n }}\n // Figma shows \"All statuses\" in the placeholder colour (text/tertiary), a chosen status in text/primary.\n renderValue={(option) => (option.value === ALL ? <span className=\"tm-status-filter__all\">{option.label}</span> : option.label)}\n />\n );\n});\n"],"mappings":";;;;;;;AAMA,IAAMA,IAAM,cAsBCC,IAA+B,kBAAiD,SAC3F,EAAE,YAAS,cAAW,gBAAgB,UAAO,kBAAe,MAAM,kBAAe,cAAW,GAAGC,KAC/F,GACA;CACA,IAAM,CAACC,GAAUC,KAAeC,EAAwBC,CAAY,GAC9DC,IAAUC,MAAU,KAAA,IAAYL,IAAWK,GAC3CC,IAAU,OAAOC,KAAa,WAAWA,IAAW,gBACpDC,IAAaC,QAA8B,CAAC;EAAE,OAAOZ;EAAK,OAAOU;EAAU,WAAWD;CAAQ,GAAG,GAAGI,CAAO,GAAG;EAACH;EAAUD;EAASI;CAAO,CAAC;CAEhJ,OACE,kBAACC,GAAD;EACO;EACL,GAAIZ;EACJ,WAAWa,EAAG,oBAAoBC,CAAS;EAC3C,MAAK;EACL,SAASL;EACT,OAAOJ,KAAWP;EAClB,gBAAgB,MAAS;GACvB,IAAMiB,IAAWC,MAASlB,IAAM,OAAOkB;GAEvC,AADIV,MAAU,KAAA,KAAWJ,EAAYa,CAAQ,GAC7CE,IAAgBF,CAAQ;EAC1B;EAEA,cAAc,MAAYG,EAAO,UAAUpB,IAAM,kBAAC,QAAD;GAAM,WAAU;GAAyB,UAAAoB,EAAO;EAAY,CAAA,IAAIA,EAAO;CACzH,CAAA;AAEL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusTag.cjs","names":["cn","require_cn","react","react_jsx_runtime","StatusTag","props","className","tone"],"sources":["../../../src/components/StatusTag/StatusTag.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes } from 'react';\nimport { cn } from '../../utils/cn';\nimport './StatusTag.css';\n\n/** Figma \"Property 1\": Success · Warning · Error · Info · Draft */\nexport type StatusTagTone = 'success' | 'warning' | 'error' | 'info' | 'draft';\n\nexport interface StatusTagProps extends HTMLAttributes<HTMLSpanElement> {\n
|
|
1
|
+
{"version":3,"file":"StatusTag.cjs","names":["cn","require_cn","react","react_jsx_runtime","StatusTag","props","className","tone"],"sources":["../../../src/components/StatusTag/StatusTag.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes } from 'react';\nimport { cn } from '../../utils/cn';\nimport './StatusTag.css';\n\n/** Figma \"Property 1\": Success · Warning · Error · Info · Draft */\nexport type StatusTagTone = 'success' | 'warning' | 'error' | 'info' | 'draft';\n\nexport interface StatusTagProps extends HTMLAttributes<HTMLSpanElement> {\n /**\n * Colour of the tag. `draft` is the neutral grey one.\n * Defaults to `draft`, the neutral tone. Figma's default variant is Success; the package keeps the neutral default on\n * purpose, so pass `tone` whenever the status is known.\n */\n tone?: StatusTagTone;\n}\n\n/** Small coloured status pill (Figma component set \"Status tag\"). The text is the children. */\nexport const StatusTag = /* @__PURE__ */ forwardRef<HTMLSpanElement, StatusTagProps>(function StatusTag(\n { tone = 'draft', className, children, ...props },\n ref,\n) {\n return (\n <span ref={ref} className={cn('tm-status-tag', className)} data-tone={tone} {...props}>\n {children}\n </span>\n );\n});\n"],"mappings":"A,wIAiBA,IAAaI,GAA4B,EAAAF,EAAA,WAAA,CAA4C,SACnF,CAAE,OAAO,QAAS,YAAW,WAAU,GAAGG,GAC1C,EACA,CACA,OACE,EAAAF,EAAA,IAAA,CAAC,OAAD,CAAW,MAAK,UAAWH,EAAAA,GAAG,gBAAiBM,CAAS,EAAG,YAAWC,EAAM,GAAIF,EAC7E,UACG,CAAA,CAEV,CAAC,E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusTag.js","names":["StatusTag","props","cn","className","tone"],"sources":["../../../src/components/StatusTag/StatusTag.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes } from 'react';\nimport { cn } from '../../utils/cn';\nimport './StatusTag.css';\n\n/** Figma \"Property 1\": Success · Warning · Error · Info · Draft */\nexport type StatusTagTone = 'success' | 'warning' | 'error' | 'info' | 'draft';\n\nexport interface StatusTagProps extends HTMLAttributes<HTMLSpanElement> {\n
|
|
1
|
+
{"version":3,"file":"StatusTag.js","names":["StatusTag","props","cn","className","tone"],"sources":["../../../src/components/StatusTag/StatusTag.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes } from 'react';\nimport { cn } from '../../utils/cn';\nimport './StatusTag.css';\n\n/** Figma \"Property 1\": Success · Warning · Error · Info · Draft */\nexport type StatusTagTone = 'success' | 'warning' | 'error' | 'info' | 'draft';\n\nexport interface StatusTagProps extends HTMLAttributes<HTMLSpanElement> {\n /**\n * Colour of the tag. `draft` is the neutral grey one.\n * Defaults to `draft`, the neutral tone. Figma's default variant is Success; the package keeps the neutral default on\n * purpose, so pass `tone` whenever the status is known.\n */\n tone?: StatusTagTone;\n}\n\n/** Small coloured status pill (Figma component set \"Status tag\"). The text is the children. */\nexport const StatusTag = /* @__PURE__ */ forwardRef<HTMLSpanElement, StatusTagProps>(function StatusTag(\n { tone = 'draft', className, children, ...props },\n ref,\n) {\n return (\n <span ref={ref} className={cn('tm-status-tag', className)} data-tone={tone} {...props}>\n {children}\n </span>\n );\n});\n"],"mappings":";;;;;;AAiBA,IAAaA,IAA4B,kBAA4C,SACnF,EAAE,UAAO,SAAS,cAAW,aAAU,GAAGC,KAC1C,GACA;CACA,OACE,kBAAC,QAAD;EAAW;EAAK,WAAWC,EAAG,iBAAiBC,CAAS;EAAG,aAAWC;EAAM,GAAIH;EAC7E;CACG,CAAA;AAEV,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";const e=require("../../utils/cn.cjs");;/* empty css */let t=require("react"),n=require("react/jsx-runtime");var r=(0,t.forwardRef)(function({step:t,title:r,children:i,headingLevel:a=3,className:
|
|
1
|
+
"use client";const e=require("../../utils/cn.cjs");;/* empty css */let t=require("react"),n=require("react/jsx-runtime");var r=(0,t.forwardRef)(function({step:t,title:r,children:i,headingLevel:a=3,variant:o=`default`,align:s,highlighted:c=!1,className:l,...u},d){let f=`h${a}`;return(0,n.jsxs)(`div`,{ref:d,className:e.cn(`tm-step-card`,l),"data-variant":o,"data-align":s,"data-highlighted":c?``:void 0,...u,children:[(0,n.jsxs)(f,{className:`tm-step-card__heading`,children:[t!=null&&t!==!1?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`span`,{className:`tm-step-card__step`,children:t}),` `]}):null,(0,n.jsx)(`span`,{className:`tm-step-card__title`,children:r})]}),i!=null&&i!==!1?(0,n.jsx)(`div`,{className:`tm-step-card__text`,children:i}):null]})}),i=(0,t.forwardRef)(function({className:r,children:i,...a},o){return(0,n.jsx)(`ol`,{ref:o,className:e.cn(`tm-steps`,r),...a,children:t.Children.map(i,e=>e==null||typeof e==`boolean`?null:(0,n.jsx)(`li`,{className:`tm-steps__item`,children:e}))})});exports.StepCard=r,exports.Steps=i;
|
|
2
2
|
//# sourceMappingURL=StepCard.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepCard.cjs","names":["cn","_Fragment","Children","require_cn","react","react_jsx_runtime","StepCard","props","Heading","headingLevel","className","step","title","children","Steps","child"],"sources":["../../../src/components/StepCard/StepCard.tsx"],"sourcesContent":["import { Children, forwardRef, type HTMLAttributes, type OlHTMLAttributes, type ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\nimport './StepCard.css';\n\n/** Heading level of the step title (`<h2>`–`<h6>`); it depends on where the block sits in the page outline. */\nexport type StepHeadingLevel = 2 | 3 | 4 | 5 | 6;\n\nexport interface StepCardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {\n /** Label above the title, e.g. \"Step 01\" (Figma \"Step 01\"). Part of the heading, so it is read with the title. */\n step?: ReactNode;\n /** What happens in this step (Figma title, drawn in the link colour). */\n title: ReactNode;\n /** The explanation under the title. */\n children?: ReactNode;\n /** Heading level of the step label + title. Defaults to `3`. */\n headingLevel?: StepHeadingLevel;\n}\n\n
|
|
1
|
+
{"version":3,"file":"StepCard.cjs","names":["cn","_Fragment","Children","require_cn","react","react_jsx_runtime","StepCard","props","Heading","headingLevel","className","variant","align","highlighted","step","title","children","Steps","child"],"sources":["../../../src/components/StepCard/StepCard.tsx"],"sourcesContent":["import { Children, forwardRef, type HTMLAttributes, type OlHTMLAttributes, type ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\nimport './StepCard.css';\n\n/** Heading level of the step title (`<h2>`–`<h6>`); it depends on where the block sits in the page outline. */\nexport type StepHeadingLevel = 2 | 3 | 4 | 5 | 6;\n\n/**\n * `default`: the Figma component (step label H3 in text/primary, text Body). `showcase`: the look of the instances on the\n * Figma home page (\"How it works\", Home 135:53 / Home - Mobile 2428:10312): a large neutral/gray-400 step label and the\n * text in Body-Small neutral/gray-600.\n */\nexport type StepCardVariant = 'default' | 'showcase';\n\n/** `end` aligns the label, title and text to the end edge (the cards left of a centre line on the home page). */\nexport type StepCardAlign = 'start' | 'end';\n\nexport interface StepCardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {\n /** Label above the title, e.g. \"Step 01\" (Figma \"Step 01\"). Part of the heading, so it is read with the title. */\n step?: ReactNode;\n /** What happens in this step (Figma title, drawn in the link colour). */\n title: ReactNode;\n /** The explanation under the title. */\n children?: ReactNode;\n /** Heading level of the step label + title. Defaults to `3`. */\n headingLevel?: StepHeadingLevel;\n /** Look of the card: the Figma component (`default`) or the home page's `showcase` instances. */\n variant?: StepCardVariant;\n /**\n * Text alignment; `end` also puts a narrowed text box (`--tm-step-card-text-max-width`) on the end edge. Leave it unset to\n * inherit the surrounding alignment. To switch it per breakpoint, set the custom property `--tm-step-card-align`\n * (`start` | `end`) on the card from CSS instead.\n */\n align?: StepCardAlign;\n /**\n * Shows the step label in the link colour (with a 0.4s colour transition, none with reduced motion), e.g. once a route\n * animation has reached this step. Not in Figma. When the state lives in the DOM rather than in React (an attribute set\n * by a scroll script on an ancestor), set `--tm-step-card-step-color: var(--tm-text-link)` from CSS instead.\n */\n highlighted?: boolean;\n}\n\n/**\n * One step of a \"how it works\" block (Figma component \"Steps element\"): step label, title, text.\n * Public custom properties: `--tm-step-card-align` (`start` | `end`, see `align`), `--tm-step-card-text-max-width`\n * (max width of the text under the title; none by default — the home page narrows it to Figma's 318px) and\n * `--tm-step-card-step-color` (colour of the step label; eases like `highlighted`).\n */\nexport const StepCard = /* @__PURE__ */ forwardRef<HTMLDivElement, StepCardProps>(function StepCard(\n { step, title, children, headingLevel = 3, variant = 'default', align, highlighted = false, className, ...props },\n ref,\n) {\n const Heading = `h${headingLevel}` as 'h3';\n return (\n <div\n ref={ref}\n className={cn('tm-step-card', className)}\n data-variant={variant}\n data-align={align}\n data-highlighted={highlighted ? '' : undefined}\n {...props}\n >\n <Heading className=\"tm-step-card__heading\">\n {step != null && step !== false ? (\n <>\n <span className=\"tm-step-card__step\">{step}</span>{' '}\n </>\n ) : null}\n <span className=\"tm-step-card__title\">{title}</span>\n </Heading>\n {children != null && children !== false ? <div className=\"tm-step-card__text\">{children}</div> : null}\n </div>\n );\n});\n\nexport type StepsProps = OlHTMLAttributes<HTMLOListElement>;\n\n/**\n * Lays `StepCard`s out as an ordered list: equal columns that wrap onto new rows when a step would get narrower\n * than 240px (one column on phones). Not a Figma component — the page designs place the steps side by side.\n */\nexport const Steps = /* @__PURE__ */ forwardRef<HTMLOListElement, StepsProps>(function Steps({ className, children, ...props }, ref) {\n return (\n <ol ref={ref} className={cn('tm-steps', className)} {...props}>\n {Children.map(children, (child) => (child == null || typeof child === 'boolean' ? null : <li className=\"tm-steps__item\">{child}</li>))}\n </ol>\n );\n});\n"],"mappings":"A,uIAgDA,IAAaM,GAA2B,EAAAF,EAAA,WAAA,CAA0C,SAChF,CAAE,OAAM,QAAO,WAAU,eAAe,EAAG,UAAU,UAAW,QAAO,cAAc,GAAO,YAAW,GAAGG,GAC1G,EACA,CACA,IAAMC,EAAU,IAAIC,IACpB,OACE,EAAAJ,EAAA,KAAA,CAAC,MAAD,CACO,MACL,UAAWL,EAAAA,GAAG,eAAgBU,CAAS,EACvC,eAAcC,EACd,aAAYC,EACZ,mBAAkBC,EAAc,GAAK,IAAA,GACrC,GAAIN,EANN,SAAA,EAQE,EAAAF,EAAA,KAAA,CAACG,EAAD,CAAS,UAAU,wBAAnB,SAAA,CACGM,GAAQ,MAAQA,IAAS,IACxB,EAAAT,EAAA,KAAA,CAAAJ,EAAAA,SAAA,CAAA,SAAA,EACE,EAAAI,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,qBAAsB,SAAAS,CAAW,CAAA,EAAE,GACnD,CAAA,CAAA,EACA,MACJ,EAAAT,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,sBAAuB,SAAAU,CAAY,CAAA,CAC5C,CACR,CAAA,EAAAC,GAAY,MAAQA,IAAa,IAAQ,EAAAX,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,qBAAsB,UAAc,CAAA,EAAI,IAC9F,C,EAET,CAAC,EAQYY,GAAwB,EAAAb,EAAA,WAAA,CAAyC,SAAe,CAAE,YAAW,WAAU,GAAGG,GAAS,EAAK,CACnI,OACE,EAAAF,EAAA,IAAA,CAAC,KAAD,CAAS,MAAK,UAAWL,EAAAA,GAAG,WAAYU,CAAS,EAAG,GAAIH,EACrD,SAAAL,EAAAA,SAAS,IAAIc,EAAW,GAAWE,GAAS,MAAQ,OAAOA,GAAU,UAAY,MAAO,EAAAb,EAAA,IAAA,CAAC,KAAD,CAAI,UAAU,iBAAkB,SAAAa,CAAU,CAAA,CAAE,CACnI,CAAA,CAER,CAAC,E"}
|
|
@@ -4,13 +4,16 @@ import { cn as e } from "../../utils/cn.js";
|
|
|
4
4
|
import { Children as t, forwardRef as n } from "react";
|
|
5
5
|
import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
6
|
// src/components/StepCard/StepCard.tsx
|
|
7
|
-
var o = /* @__PURE__ */ n(function({ step: t, title: n, children: o, headingLevel: s = 3,
|
|
8
|
-
let
|
|
7
|
+
var o = /* @__PURE__ */ n(function({ step: t, title: n, children: o, headingLevel: s = 3, variant: c = "default", align: l, highlighted: u = !1, className: d, ...f }, p) {
|
|
8
|
+
let m = `h${s}`;
|
|
9
9
|
return /* @__PURE__ */ a("div", {
|
|
10
|
-
ref:
|
|
11
|
-
className: e("tm-step-card",
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
ref: p,
|
|
11
|
+
className: e("tm-step-card", d),
|
|
12
|
+
"data-variant": c,
|
|
13
|
+
"data-align": l,
|
|
14
|
+
"data-highlighted": u ? "" : void 0,
|
|
15
|
+
...f,
|
|
16
|
+
children: [/* @__PURE__ */ a(m, {
|
|
14
17
|
className: "tm-step-card__heading",
|
|
15
18
|
children: [t != null && t !== !1 ? /* @__PURE__ */ a(r, { children: [/* @__PURE__ */ i("span", {
|
|
16
19
|
className: "tm-step-card__step",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepCard.js","names":["_Fragment","Fragment$1","StepCard","props","Heading","headingLevel","cn","className","step","title","children","Steps","Children","child"],"sources":["../../../src/components/StepCard/StepCard.tsx"],"sourcesContent":["import { Children, forwardRef, type HTMLAttributes, type OlHTMLAttributes, type ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\nimport './StepCard.css';\n\n/** Heading level of the step title (`<h2>`–`<h6>`); it depends on where the block sits in the page outline. */\nexport type StepHeadingLevel = 2 | 3 | 4 | 5 | 6;\n\nexport interface StepCardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {\n /** Label above the title, e.g. \"Step 01\" (Figma \"Step 01\"). Part of the heading, so it is read with the title. */\n step?: ReactNode;\n /** What happens in this step (Figma title, drawn in the link colour). */\n title: ReactNode;\n /** The explanation under the title. */\n children?: ReactNode;\n /** Heading level of the step label + title. Defaults to `3`. */\n headingLevel?: StepHeadingLevel;\n}\n\n
|
|
1
|
+
{"version":3,"file":"StepCard.js","names":["_Fragment","Fragment$1","StepCard","props","Heading","headingLevel","cn","className","variant","align","highlighted","step","title","children","Steps","Children","child"],"sources":["../../../src/components/StepCard/StepCard.tsx"],"sourcesContent":["import { Children, forwardRef, type HTMLAttributes, type OlHTMLAttributes, type ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\nimport './StepCard.css';\n\n/** Heading level of the step title (`<h2>`–`<h6>`); it depends on where the block sits in the page outline. */\nexport type StepHeadingLevel = 2 | 3 | 4 | 5 | 6;\n\n/**\n * `default`: the Figma component (step label H3 in text/primary, text Body). `showcase`: the look of the instances on the\n * Figma home page (\"How it works\", Home 135:53 / Home - Mobile 2428:10312): a large neutral/gray-400 step label and the\n * text in Body-Small neutral/gray-600.\n */\nexport type StepCardVariant = 'default' | 'showcase';\n\n/** `end` aligns the label, title and text to the end edge (the cards left of a centre line on the home page). */\nexport type StepCardAlign = 'start' | 'end';\n\nexport interface StepCardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {\n /** Label above the title, e.g. \"Step 01\" (Figma \"Step 01\"). Part of the heading, so it is read with the title. */\n step?: ReactNode;\n /** What happens in this step (Figma title, drawn in the link colour). */\n title: ReactNode;\n /** The explanation under the title. */\n children?: ReactNode;\n /** Heading level of the step label + title. Defaults to `3`. */\n headingLevel?: StepHeadingLevel;\n /** Look of the card: the Figma component (`default`) or the home page's `showcase` instances. */\n variant?: StepCardVariant;\n /**\n * Text alignment; `end` also puts a narrowed text box (`--tm-step-card-text-max-width`) on the end edge. Leave it unset to\n * inherit the surrounding alignment. To switch it per breakpoint, set the custom property `--tm-step-card-align`\n * (`start` | `end`) on the card from CSS instead.\n */\n align?: StepCardAlign;\n /**\n * Shows the step label in the link colour (with a 0.4s colour transition, none with reduced motion), e.g. once a route\n * animation has reached this step. Not in Figma. When the state lives in the DOM rather than in React (an attribute set\n * by a scroll script on an ancestor), set `--tm-step-card-step-color: var(--tm-text-link)` from CSS instead.\n */\n highlighted?: boolean;\n}\n\n/**\n * One step of a \"how it works\" block (Figma component \"Steps element\"): step label, title, text.\n * Public custom properties: `--tm-step-card-align` (`start` | `end`, see `align`), `--tm-step-card-text-max-width`\n * (max width of the text under the title; none by default — the home page narrows it to Figma's 318px) and\n * `--tm-step-card-step-color` (colour of the step label; eases like `highlighted`).\n */\nexport const StepCard = /* @__PURE__ */ forwardRef<HTMLDivElement, StepCardProps>(function StepCard(\n { step, title, children, headingLevel = 3, variant = 'default', align, highlighted = false, className, ...props },\n ref,\n) {\n const Heading = `h${headingLevel}` as 'h3';\n return (\n <div\n ref={ref}\n className={cn('tm-step-card', className)}\n data-variant={variant}\n data-align={align}\n data-highlighted={highlighted ? '' : undefined}\n {...props}\n >\n <Heading className=\"tm-step-card__heading\">\n {step != null && step !== false ? (\n <>\n <span className=\"tm-step-card__step\">{step}</span>{' '}\n </>\n ) : null}\n <span className=\"tm-step-card__title\">{title}</span>\n </Heading>\n {children != null && children !== false ? <div className=\"tm-step-card__text\">{children}</div> : null}\n </div>\n );\n});\n\nexport type StepsProps = OlHTMLAttributes<HTMLOListElement>;\n\n/**\n * Lays `StepCard`s out as an ordered list: equal columns that wrap onto new rows when a step would get narrower\n * than 240px (one column on phones). Not a Figma component — the page designs place the steps side by side.\n */\nexport const Steps = /* @__PURE__ */ forwardRef<HTMLOListElement, StepsProps>(function Steps({ className, children, ...props }, ref) {\n return (\n <ol ref={ref} className={cn('tm-steps', className)} {...props}>\n {Children.map(children, (child) => (child == null || typeof child === 'boolean' ? null : <li className=\"tm-steps__item\">{child}</li>))}\n </ol>\n );\n});\n"],"mappings":";;;;;;AAgDA,IAAaE,IAA2B,kBAA0C,SAChF,EAAE,SAAM,UAAO,aAAU,kBAAe,GAAG,aAAU,WAAW,UAAO,iBAAc,IAAO,cAAW,GAAGC,KAC1G,GACA;CACA,IAAMC,IAAU,IAAIC;CACpB,OACE,kBAAC,OAAD;EACO;EACL,WAAWC,EAAG,gBAAgBC,CAAS;EACvC,gBAAcC;EACd,cAAYC;EACZ,oBAAkBC,IAAc,KAAK,KAAA;EACrC,GAAIP;EANN,UAAA,CAQE,kBAACC,GAAD;GAAS,WAAU;GAAnB,UAAA,CACGO,KAAQ,QAAQA,MAAS,KACxB,kBAAAX,GAAA,EAAA,UAAA,CACE,kBAAC,QAAD;IAAM,WAAU;IAAsB,UAAAW;GAAW,CAAA,GAAE,GACnD,EAAA,CAAA,IACA,MACJ,kBAAC,QAAD;IAAM,WAAU;IAAuB,UAAAC;GAAY,CAAA,CAC5C;EACR,CAAA,GAAAC,KAAY,QAAQA,MAAa,KAAQ,kBAAC,OAAD;GAAK,WAAU;GAAsB;EAAc,CAAA,IAAI,IAC9F;;AAET,CAAC,GAQYC,IAAwB,kBAAyC,SAAe,EAAE,cAAW,aAAU,GAAGX,KAAS,GAAK;CACnI,OACE,kBAAC,MAAD;EAAS;EAAK,WAAWG,EAAG,YAAYC,CAAS;EAAG,GAAIJ;EACrD,UAAAY,EAAS,IAAIF,IAAW,MAAWG,KAAS,QAAQ,OAAOA,KAAU,YAAY,OAAO,kBAAC,MAAD;GAAI,WAAU;GAAkB,UAAAA;EAAU,CAAA,CAAE;CACnI,CAAA;AAER,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";const e=require("../../utils/cn.cjs");;/* empty css */let t=require("react"),n=require("react/jsx-runtime");var r=(e,t)=>`Step ${e} of ${t}`,i=(0,t.forwardRef)(function({steps:i,currentStep:a,formatStepCount:o=r,className:s,...c},l){let u=(0,t.useId)(),d=i.length,f=Math.min(Math.max(a,1),Math.max(d,1)),p=i[f-1];return(0,n.jsxs)(`div`,{ref:l,className:e.cn(`tm-step-progress`,s),...c,children:[(0,n.jsxs)(`p`,{id:u,className:`tm-step-progress__label`,children:[(0,n.jsx)(`span`,{className:`tm-step-progress__count`,children:o(f,d)}),p!=null&&p!==!1?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`span`,{className:`tm-step-progress__dot`,"aria-hidden":`true`,children:`·`}),(0,n.jsx)(`span`,{className:`tm-step-progress__name`,children:p})]}):null]}),(0,n.jsx)(`div`,{className:`tm-step-progress__bar`,role:`progressbar`,"aria-labelledby":u,"aria-valuemin":1,"aria-valuemax":d,"aria-valuenow":f,children:i.map((e,t)=>(0,n.jsx)(`span`,{className:`tm-step-progress__segment`,"data-filled":t<f?``:void 0},t))})]})});exports.StepProgress=i;
|
|
2
|
+
//# sourceMappingURL=StepProgress.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StepProgress.cjs","names":["useId","cn","_Fragment","require_cn","react","react_jsx_runtime","defaultFormatStepCount","current","total","StepProgress","props","labelId","steps","currentStep","name","className","formatStepCount","index"],"sources":["../../../src/components/StepProgress/StepProgress.tsx"],"sourcesContent":["import { forwardRef, useId, type HTMLAttributes, type ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\nimport './StepProgress.css';\n\nexport interface StepProgressProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {\n /** Step names in order, e.g. Destination / Dates & travellers / Package & budget / Review (Figma \"Count\" = their number). */\n steps: ReactNode[];\n /** The step the user is on, 1-based (Figma \"Step\"). That many bar segments are filled. */\n currentStep: number;\n /** The \"Step 2 of 4\" text — translate it. */\n formatStepCount?: (current: number, total: number) => ReactNode;\n}\n\nconst defaultFormatStepCount = (current: number, total: number): ReactNode => `Step ${current} of ${total}`;\n\n/**\n * Figma component set \"Step progress\" (2735:16901): a compact progress line for a multi-step form —\n * \"Step 2 of 4 · Dates & travellers\" over a segmented bar. The bar is a `progressbar` named by that line.\n */\nexport const StepProgress = /* @__PURE__ */ forwardRef<HTMLDivElement, StepProgressProps>(function StepProgress(\n { steps, currentStep, formatStepCount = defaultFormatStepCount, className, ...props },\n ref,\n) {\n const labelId = useId();\n const total = steps.length;\n const current = Math.min(Math.max(currentStep, 1), Math.max(total, 1));\n const name = steps[current - 1];\n\n return (\n <div ref={ref} className={cn('tm-step-progress', className)} {...props}>\n <p id={labelId} className=\"tm-step-progress__label\">\n <span className=\"tm-step-progress__count\">{formatStepCount(current, total)}</span>\n {name != null && name !== false ? (\n <>\n <span className=\"tm-step-progress__dot\" aria-hidden=\"true\">\n ·\n </span>\n <span className=\"tm-step-progress__name\">{name}</span>\n </>\n ) : null}\n </p>\n <div\n className=\"tm-step-progress__bar\"\n role=\"progressbar\"\n aria-labelledby={labelId}\n aria-valuemin={1}\n aria-valuemax={total}\n aria-valuenow={current}\n >\n {steps.map((_, index) => (\n <span key={index} className=\"tm-step-progress__segment\" data-filled={index < current ? '' : undefined} />\n ))}\n </div>\n </div>\n );\n});\n"],"mappings":"A,2IAaA,IAAMM,GAA0B,EAAiB,IAA6B,QAAQC,EAAQ,MAAMC,IAMvFC,GAA+B,EAAAL,EAAA,WAAA,CAA8C,SACxF,CAAE,QAAO,cAAa,kBAAkBE,EAAwB,YAAW,GAAGI,GAC9E,EACA,CACA,IAAMC,GAAA,EAAUX,EAAAA,MAAAA,CAAM,EAChBQ,EAAQI,EAAM,OACdL,EAAU,KAAK,IAAI,KAAK,IAAIM,EAAa,CAAC,EAAG,KAAK,IAAIL,EAAO,CAAC,CAAC,EAC/DM,EAAOF,EAAML,EAAU,GAE7B,OACE,EAAAF,EAAA,KAAA,CAAC,MAAD,CAAU,MAAK,UAAWJ,EAAAA,GAAG,mBAAoBc,CAAS,EAAG,GAAIL,EAAjE,SAAA,EACE,EAAAL,EAAA,KAAA,CAAC,IAAD,CAAG,GAAIM,EAAS,UAAU,0BAA1B,SAAA,EACE,EAAAN,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,0BAA2B,SAAAW,EAAgBT,EAASC,CAAK,CAAQ,CAAA,EAChFM,GAAQ,MAAQA,IAAS,IACxB,EAAAT,EAAA,KAAA,CAAAH,EAAAA,SAAA,CAAA,SAAA,EACE,EAAAG,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,wBAAwB,cAAY,OAAO,SAAA,GAErD,CAAA,GACN,EAAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,yBAA0B,SAAAS,CAAW,CAAA,CACrD,CAAA,CAAA,EACA,IACH,CACH,CAAA,GAAA,EAAAT,EAAA,IAAA,CAAC,MAAD,CACE,UAAU,wBACV,KAAK,cACL,kBAAiBM,EACjB,gBAAe,EACf,gBAAeH,EACf,gBAAeD,EAEd,SAAAK,EAAM,KAAK,EAAG,KACb,EAAAP,EAAA,IAAA,CAAC,OAAD,CAAkB,UAAU,4BAA4B,cAAaY,EAAQV,EAAU,GAAK,IAAA,EAAY,EAA7FU,CAA6F,CACzG,CACE,CAAA,CACF,C,EAET,CAAC,E"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../utils/cn.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
import { forwardRef as t, useId as n } from "react";
|
|
5
|
+
import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
// src/components/StepProgress/StepProgress.tsx
|
|
7
|
+
var o = (e, t) => `Step ${e} of ${t}`, s = /* @__PURE__ */ t(function({ steps: t, currentStep: s, formatStepCount: c = o, className: l, ...u }, d) {
|
|
8
|
+
let f = n(), p = t.length, m = Math.min(Math.max(s, 1), Math.max(p, 1)), h = t[m - 1];
|
|
9
|
+
return /* @__PURE__ */ a("div", {
|
|
10
|
+
ref: d,
|
|
11
|
+
className: e("tm-step-progress", l),
|
|
12
|
+
...u,
|
|
13
|
+
children: [/* @__PURE__ */ a("p", {
|
|
14
|
+
id: f,
|
|
15
|
+
className: "tm-step-progress__label",
|
|
16
|
+
children: [/* @__PURE__ */ i("span", {
|
|
17
|
+
className: "tm-step-progress__count",
|
|
18
|
+
children: c(m, p)
|
|
19
|
+
}), h != null && h !== !1 ? /* @__PURE__ */ a(r, { children: [/* @__PURE__ */ i("span", {
|
|
20
|
+
className: "tm-step-progress__dot",
|
|
21
|
+
"aria-hidden": "true",
|
|
22
|
+
children: "·"
|
|
23
|
+
}), /* @__PURE__ */ i("span", {
|
|
24
|
+
className: "tm-step-progress__name",
|
|
25
|
+
children: h
|
|
26
|
+
})] }) : null]
|
|
27
|
+
}), /* @__PURE__ */ i("div", {
|
|
28
|
+
className: "tm-step-progress__bar",
|
|
29
|
+
role: "progressbar",
|
|
30
|
+
"aria-labelledby": f,
|
|
31
|
+
"aria-valuemin": 1,
|
|
32
|
+
"aria-valuemax": p,
|
|
33
|
+
"aria-valuenow": m,
|
|
34
|
+
children: t.map((e, t) => /* @__PURE__ */ i("span", {
|
|
35
|
+
className: "tm-step-progress__segment",
|
|
36
|
+
"data-filled": t < m ? "" : void 0
|
|
37
|
+
}, t))
|
|
38
|
+
})]
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
export { s as StepProgress };
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=StepProgress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StepProgress.js","names":["_Fragment","Fragment$1","defaultFormatStepCount","current","total","StepProgress","props","labelId","useId","steps","currentStep","name","cn","className","formatStepCount","index"],"sources":["../../../src/components/StepProgress/StepProgress.tsx"],"sourcesContent":["import { forwardRef, useId, type HTMLAttributes, type ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\nimport './StepProgress.css';\n\nexport interface StepProgressProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {\n /** Step names in order, e.g. Destination / Dates & travellers / Package & budget / Review (Figma \"Count\" = their number). */\n steps: ReactNode[];\n /** The step the user is on, 1-based (Figma \"Step\"). That many bar segments are filled. */\n currentStep: number;\n /** The \"Step 2 of 4\" text — translate it. */\n formatStepCount?: (current: number, total: number) => ReactNode;\n}\n\nconst defaultFormatStepCount = (current: number, total: number): ReactNode => `Step ${current} of ${total}`;\n\n/**\n * Figma component set \"Step progress\" (2735:16901): a compact progress line for a multi-step form —\n * \"Step 2 of 4 · Dates & travellers\" over a segmented bar. The bar is a `progressbar` named by that line.\n */\nexport const StepProgress = /* @__PURE__ */ forwardRef<HTMLDivElement, StepProgressProps>(function StepProgress(\n { steps, currentStep, formatStepCount = defaultFormatStepCount, className, ...props },\n ref,\n) {\n const labelId = useId();\n const total = steps.length;\n const current = Math.min(Math.max(currentStep, 1), Math.max(total, 1));\n const name = steps[current - 1];\n\n return (\n <div ref={ref} className={cn('tm-step-progress', className)} {...props}>\n <p id={labelId} className=\"tm-step-progress__label\">\n <span className=\"tm-step-progress__count\">{formatStepCount(current, total)}</span>\n {name != null && name !== false ? (\n <>\n <span className=\"tm-step-progress__dot\" aria-hidden=\"true\">\n ·\n </span>\n <span className=\"tm-step-progress__name\">{name}</span>\n </>\n ) : null}\n </p>\n <div\n className=\"tm-step-progress__bar\"\n role=\"progressbar\"\n aria-labelledby={labelId}\n aria-valuemin={1}\n aria-valuemax={total}\n aria-valuenow={current}\n >\n {steps.map((_, index) => (\n <span key={index} className=\"tm-step-progress__segment\" data-filled={index < current ? '' : undefined} />\n ))}\n </div>\n </div>\n );\n});\n"],"mappings":";;;;;;AAaA,IAAME,KAA0B,GAAiB,MAA6B,QAAQC,EAAQ,MAAMC,KAMvFC,IAA+B,kBAA8C,SACxF,EAAE,UAAO,gBAAa,qBAAkBH,GAAwB,cAAW,GAAGI,KAC9E,GACA;CACA,IAAMC,IAAUC,EAAM,GAChBJ,IAAQK,EAAM,QACdN,IAAU,KAAK,IAAI,KAAK,IAAIO,GAAa,CAAC,GAAG,KAAK,IAAIN,GAAO,CAAC,CAAC,GAC/DO,IAAOF,EAAMN,IAAU;CAE7B,OACE,kBAAC,OAAD;EAAU;EAAK,WAAWS,EAAG,oBAAoBC,CAAS;EAAG,GAAIP;EAAjE,UAAA,CACE,kBAAC,KAAD;GAAG,IAAIC;GAAS,WAAU;GAA1B,UAAA,CACE,kBAAC,QAAD;IAAM,WAAU;IAA2B,UAAAO,EAAgBX,GAASC,CAAK;GAAQ,CAAA,GAChFO,KAAQ,QAAQA,MAAS,KACxB,kBAAAX,GAAA,EAAA,UAAA,CACE,kBAAC,QAAD;IAAM,WAAU;IAAwB,eAAY;IAAO,UAAA;GAErD,CAAA,GACN,kBAAC,QAAD;IAAM,WAAU;IAA0B,UAAAW;GAAW,CAAA,CACrD,EAAA,CAAA,IACA,IACH;EACH,CAAA,GAAA,kBAAC,OAAD;GACE,WAAU;GACV,MAAK;GACL,mBAAiBJ;GACjB,iBAAe;GACf,iBAAeH;GACf,iBAAeD;GAEd,UAAAM,EAAM,KAAK,GAAG,MACb,kBAAC,QAAD;IAAkB,WAAU;IAA4B,eAAaM,IAAQZ,IAAU,KAAK,KAAA;GAAY,GAA7FY,CAA6F,CACzG;EACE,CAAA,CACF;;AAET,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";const e=require("../../icons/generated/SendIcon.cjs"),t=require("../../utils/cn.cjs"),n=require("../Button/Button.cjs"),r=require("../IconTile/IconTile.cjs");;/* empty css */let i=require("react"),a=require("react/jsx-runtime");var o=(0,i.forwardRef)(function({connected:i=!1,title:o,actionLabel:s,onAction:c,actionHref:l,actionLoading:u=!1,icon:d,className:f,children:p,...m},h){let g=i?`text`:`primary`;return(0,a.jsxs)(`div`,{ref:h,className:t.cn(`tm-telegram-connect`,f),"data-state":i?`connected`:`not-connected`,...m,children:[(0,a.jsx)(r.IconTile,{className:`tm-telegram-connect__tile`,size:`md`,icon:d??(0,a.jsx)(e.SendIcon,{})}),(0,a.jsxs)(`div`,{className:`tm-telegram-connect__text`,children:[(0,a.jsx)(`div`,{className:`tm-telegram-connect__title`,children:o}),p!=null&&p!==!1?(0,a.jsx)(`div`,{className:`tm-telegram-connect__description`,children:p}):null]}),l?(0,a.jsx)(n.Button,{className:`tm-telegram-connect__action`,variant:g,size:`md`,loading:u,asChild:!0,children:(0,a.jsx)(`a`,{href:l,onClick:c,children:s})}):(0,a.jsx)(n.Button,{className:`tm-telegram-connect__action`,variant:g,size:`md`,loading:u,onClick:c,children:s})]})});exports.TelegramConnect=o;
|
|
2
|
+
//# sourceMappingURL=TelegramConnect.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TelegramConnect.cjs","names":["cn","IconTile","SendIcon","Button","require_SendIcon","require_cn","require_Button","require_IconTile","react","react_jsx_runtime","TelegramConnect","props","variant","connected","className","icon","title","children","actionHref","actionLoading","onAction","actionLabel"],"sources":["../../../src/components/TelegramConnect/TelegramConnect.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes, type MouseEvent, type ReactNode } from 'react';\nimport { SendIcon } from '../../icons';\nimport { cn } from '../../utils/cn';\nimport { Button } from '../Button';\nimport { IconTile } from '../IconTile';\nimport './TelegramConnect.css';\n\nexport interface TelegramConnectProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {\n /** Figma \"State\": `false` Not connected (default, Primary button) · `true` Connected (Text button). */\n connected?: boolean;\n /** Heading, e.g. \"Get updates in Telegram\" / \"Telegram connected\" (Figma layer \"Title\"). */\n title: ReactNode;\n /** The explanation (Figma layer \"Description\"), e.g. \"Updates go to @anna_p. Agencies never see your account.\" */\n children?: ReactNode;\n /** Text of the button, e.g. \"Connect Telegram\" / \"Disconnect\". */\n actionLabel: ReactNode;\n /** Called by the button. */\n onAction?: (event: MouseEvent<HTMLElement>) => void;\n /** Renders the button as a link instead, e.g. the bot's `https://t.me/…?start=…` deep link. */\n actionHref?: string;\n /** Spinner on the button while connecting or disconnecting. */\n actionLoading?: boolean;\n /** Icon in the tile. Defaults to Figma's paper plane (`send`). */\n icon?: ReactNode;\n}\n\n/**\n * Figma component set \"Telegram connect\" (2735:16918): the card that offers Telegram notifications\n * (Account → Notifications, request sent) and, once connected, shows where updates go with a way to disconnect.\n */\nexport const TelegramConnect = /* @__PURE__ */ forwardRef<HTMLDivElement, TelegramConnectProps>(function TelegramConnect(\n { connected = false, title, actionLabel, onAction, actionHref, actionLoading = false, icon, className, children, ...props },\n ref,\n) {\n const variant = connected ? 'text' : 'primary';\n return (\n <div ref={ref} className={cn('tm-telegram-connect', className)} data-state={connected ? 'connected' : 'not-connected'} {...props}>\n <IconTile className=\"tm-telegram-connect__tile\" size=\"md\" icon={icon ?? <SendIcon />} />\n <div className=\"tm-telegram-connect__text\">\n <div className=\"tm-telegram-connect__title\">{title}</div>\n {children != null && children !== false ? <div className=\"tm-telegram-connect__description\">{children}</div> : null}\n </div>\n {actionHref ? (\n <Button className=\"tm-telegram-connect__action\" variant={variant} size=\"md\" loading={actionLoading} asChild>\n <a href={actionHref} onClick={onAction}>\n {actionLabel}\n </a>\n </Button>\n ) : (\n <Button className=\"tm-telegram-connect__action\" variant={variant} size=\"md\" loading={actionLoading} onClick={onAction}>\n {actionLabel}\n </Button>\n )}\n </div>\n );\n});\n"],"mappings":"A,sQA8BA,IAAaU,GAAkC,EAAAF,EAAA,WAAA,CAAiD,SAC9F,CAAE,YAAY,GAAO,QAAO,cAAa,WAAU,aAAY,gBAAgB,GAAO,OAAM,YAAW,WAAU,GAAGG,GACpH,EACA,CACA,IAAMC,EAAUC,EAAY,OAAS,UACrC,OACE,EAAAJ,EAAA,KAAA,CAAC,MAAD,CAAU,MAAK,UAAWT,EAAAA,GAAG,sBAAuBc,CAAS,EAAG,aAAYD,EAAY,YAAc,gBAAiB,GAAIF,EAA3H,SAAA,EACE,EAAAF,EAAA,IAAA,CAACR,EAAAA,SAAD,CAAU,UAAU,4BAA4B,KAAK,KAAK,KAAMc,IAAQ,EAAAN,EAAA,IAAA,CAACP,EAAAA,SAAD,CAAW,CAAA,CAAI,CAAA,GACvF,EAAAO,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,4BAAf,SAAA,EACE,EAAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,6BAA8B,SAAAO,CAAW,CAAA,EACvDC,GAAY,MAAQA,IAAa,IAAQ,EAAAR,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,mCAAoC,UAAc,CAAA,EAAI,IAC5G,C,GACJS,GACC,EAAAT,EAAA,IAAA,CAACN,EAAAA,OAAD,CAAQ,UAAU,8BAAuC,UAAS,KAAK,KAAK,QAASgB,EAAe,QAAA,GAClG,UAAA,EAAAV,EAAA,IAAA,CAAC,IAAD,CAAG,KAAMS,EAAY,QAASE,EAC3B,SAAAC,CACA,CAAA,CACG,CAAA,GAER,EAAAZ,EAAA,IAAA,CAACN,EAAAA,OAAD,CAAQ,UAAU,8BAAuC,UAAS,KAAK,KAAK,QAASgB,EAAe,QAASC,EAC1G,SAAAC,CACK,CAAA,CAEP,C,EAET,CAAC,E"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { SendIcon as e } from "../../icons/generated/SendIcon.js";
|
|
3
|
+
import { cn as t } from "../../utils/cn.js";
|
|
4
|
+
import { Button as n } from "../Button/Button.js";
|
|
5
|
+
import { IconTile as r } from "../IconTile/IconTile.js";
|
|
6
|
+
/* empty css */
|
|
7
|
+
import { forwardRef as i } from "react";
|
|
8
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
9
|
+
// src/components/TelegramConnect/TelegramConnect.tsx
|
|
10
|
+
var s = /* @__PURE__ */ i(function({ connected: i = !1, title: s, actionLabel: c, onAction: l, actionHref: u, actionLoading: d = !1, icon: f, className: p, children: m, ...h }, g) {
|
|
11
|
+
let _ = i ? "text" : "primary";
|
|
12
|
+
return /* @__PURE__ */ o("div", {
|
|
13
|
+
ref: g,
|
|
14
|
+
className: t("tm-telegram-connect", p),
|
|
15
|
+
"data-state": i ? "connected" : "not-connected",
|
|
16
|
+
...h,
|
|
17
|
+
children: [
|
|
18
|
+
/* @__PURE__ */ a(r, {
|
|
19
|
+
className: "tm-telegram-connect__tile",
|
|
20
|
+
size: "md",
|
|
21
|
+
icon: f ?? /* @__PURE__ */ a(e, {})
|
|
22
|
+
}),
|
|
23
|
+
/* @__PURE__ */ o("div", {
|
|
24
|
+
className: "tm-telegram-connect__text",
|
|
25
|
+
children: [/* @__PURE__ */ a("div", {
|
|
26
|
+
className: "tm-telegram-connect__title",
|
|
27
|
+
children: s
|
|
28
|
+
}), m != null && m !== !1 ? /* @__PURE__ */ a("div", {
|
|
29
|
+
className: "tm-telegram-connect__description",
|
|
30
|
+
children: m
|
|
31
|
+
}) : null]
|
|
32
|
+
}),
|
|
33
|
+
u ? /* @__PURE__ */ a(n, {
|
|
34
|
+
className: "tm-telegram-connect__action",
|
|
35
|
+
variant: _,
|
|
36
|
+
size: "md",
|
|
37
|
+
loading: d,
|
|
38
|
+
asChild: !0,
|
|
39
|
+
children: /* @__PURE__ */ a("a", {
|
|
40
|
+
href: u,
|
|
41
|
+
onClick: l,
|
|
42
|
+
children: c
|
|
43
|
+
})
|
|
44
|
+
}) : /* @__PURE__ */ a(n, {
|
|
45
|
+
className: "tm-telegram-connect__action",
|
|
46
|
+
variant: _,
|
|
47
|
+
size: "md",
|
|
48
|
+
loading: d,
|
|
49
|
+
onClick: l,
|
|
50
|
+
children: c
|
|
51
|
+
})
|
|
52
|
+
]
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
export { s as TelegramConnect };
|
|
56
|
+
|
|
57
|
+
//# sourceMappingURL=TelegramConnect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TelegramConnect.js","names":["TelegramConnect","props","variant","connected","cn","className","IconTile","icon","SendIcon","title","children","actionHref","Button","actionLoading","onAction","actionLabel"],"sources":["../../../src/components/TelegramConnect/TelegramConnect.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes, type MouseEvent, type ReactNode } from 'react';\nimport { SendIcon } from '../../icons';\nimport { cn } from '../../utils/cn';\nimport { Button } from '../Button';\nimport { IconTile } from '../IconTile';\nimport './TelegramConnect.css';\n\nexport interface TelegramConnectProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {\n /** Figma \"State\": `false` Not connected (default, Primary button) · `true` Connected (Text button). */\n connected?: boolean;\n /** Heading, e.g. \"Get updates in Telegram\" / \"Telegram connected\" (Figma layer \"Title\"). */\n title: ReactNode;\n /** The explanation (Figma layer \"Description\"), e.g. \"Updates go to @anna_p. Agencies never see your account.\" */\n children?: ReactNode;\n /** Text of the button, e.g. \"Connect Telegram\" / \"Disconnect\". */\n actionLabel: ReactNode;\n /** Called by the button. */\n onAction?: (event: MouseEvent<HTMLElement>) => void;\n /** Renders the button as a link instead, e.g. the bot's `https://t.me/…?start=…` deep link. */\n actionHref?: string;\n /** Spinner on the button while connecting or disconnecting. */\n actionLoading?: boolean;\n /** Icon in the tile. Defaults to Figma's paper plane (`send`). */\n icon?: ReactNode;\n}\n\n/**\n * Figma component set \"Telegram connect\" (2735:16918): the card that offers Telegram notifications\n * (Account → Notifications, request sent) and, once connected, shows where updates go with a way to disconnect.\n */\nexport const TelegramConnect = /* @__PURE__ */ forwardRef<HTMLDivElement, TelegramConnectProps>(function TelegramConnect(\n { connected = false, title, actionLabel, onAction, actionHref, actionLoading = false, icon, className, children, ...props },\n ref,\n) {\n const variant = connected ? 'text' : 'primary';\n return (\n <div ref={ref} className={cn('tm-telegram-connect', className)} data-state={connected ? 'connected' : 'not-connected'} {...props}>\n <IconTile className=\"tm-telegram-connect__tile\" size=\"md\" icon={icon ?? <SendIcon />} />\n <div className=\"tm-telegram-connect__text\">\n <div className=\"tm-telegram-connect__title\">{title}</div>\n {children != null && children !== false ? <div className=\"tm-telegram-connect__description\">{children}</div> : null}\n </div>\n {actionHref ? (\n <Button className=\"tm-telegram-connect__action\" variant={variant} size=\"md\" loading={actionLoading} asChild>\n <a href={actionHref} onClick={onAction}>\n {actionLabel}\n </a>\n </Button>\n ) : (\n <Button className=\"tm-telegram-connect__action\" variant={variant} size=\"md\" loading={actionLoading} onClick={onAction}>\n {actionLabel}\n </Button>\n )}\n </div>\n );\n});\n"],"mappings":";;;;;;;;;AA8BA,IAAaA,IAAkC,kBAAiD,SAC9F,EAAE,eAAY,IAAO,UAAO,gBAAa,aAAU,eAAY,mBAAgB,IAAO,SAAM,cAAW,aAAU,GAAGC,KACpH,GACA;CACA,IAAMC,IAAUC,IAAY,SAAS;CACrC,OACE,kBAAC,OAAD;EAAU;EAAK,WAAWC,EAAG,uBAAuBC,CAAS;EAAG,cAAYF,IAAY,cAAc;EAAiB,GAAIF;EAA3H,UAAA;GACE,kBAACK,GAAD;IAAU,WAAU;IAA4B,MAAK;IAAK,MAAMC,KAAQ,kBAACC,GAAD,CAAW,CAAA;GAAI,CAAA;GACvF,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACE,kBAAC,OAAD;KAAK,WAAU;KAA8B,UAAAC;IAAW,CAAA,GACvDC,KAAY,QAAQA,MAAa,KAAQ,kBAAC,OAAD;KAAK,WAAU;KAAoC;IAAc,CAAA,IAAI,IAC5G;;GACJC,IACC,kBAACC,GAAD;IAAQ,WAAU;IAAuC;IAAS,MAAK;IAAK,SAASC;IAAe,SAAA;IAClG,UAAA,kBAAC,KAAD;KAAG,MAAMF;KAAY,SAASG;KAC3B,UAAAC;IACA,CAAA;GACG,CAAA,IAER,kBAACH,GAAD;IAAQ,WAAU;IAAuC;IAAS,MAAK;IAAK,SAASC;IAAe,SAASC;IAC1G,UAAAC;GACK,CAAA;EAEP;;AAET,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";const e=require("../../utils/cn.cjs"),t=require("../Field/Field.cjs"),n=require("../Field/focusControl.cjs");;/* empty css */let r=require("react"),i=require("react/jsx-runtime");var a=(0,r.forwardRef)(function({label:r,helperText:a,error:o,required:s,optional:c,size:l=`md`,startIcon:u,endIcon:d,prefix:f,helperIcon:p,
|
|
1
|
+
"use client";const e=require("../../utils/cn.cjs"),t=require("../Field/Field.cjs"),n=require("../Field/focusControl.cjs");;/* empty css */let r=require("react"),i=require("react/jsx-runtime");var a=(0,r.forwardRef)(function({label:r,helperText:a,error:o,required:s,optional:c,size:l=`md`,startIcon:u,endIcon:d,prefix:f,helperIcon:p,errorColor:m,errorBox:h,id:g,type:_=`text`,disabled:v,readOnly:y,className:b,style:x,"aria-describedby":S,"aria-invalid":C,...w},T){let E=t.useFieldIds(g,!!(o||a)),D=!!o,O=f?`${E.controlId}-prefix`:void 0;return(0,i.jsx)(t.FormField,{ids:E,label:r,helperText:a,error:o,required:s,optional:c,size:l,helperIcon:p,errorColor:m,errorBox:h,className:e.cn(`tm-text-input`,b),style:x,children:(0,i.jsxs)(`div`,{className:`tm-field`,"data-size":l,"data-tm-icon-size":l,"data-invalid":D?``:void 0,"data-disabled":v?``:void 0,"data-readonly":y?``:void 0,onMouseDown:n.focusControlOnMouseDown,children:[u,f?(0,i.jsx)(`span`,{className:`tm-field__prefix`,id:O,children:f}):null,(0,i.jsx)(`input`,{ref:T,id:E.controlId,type:_,className:`tm-field__control tm-text-input__control`,disabled:v,readOnly:y,required:s,"aria-invalid":C??(D||void 0),"aria-describedby":[S,O,E.messageId].filter(Boolean).join(` `)||void 0,...w}),d]})})});exports.TextInput=a;
|
|
2
2
|
//# sourceMappingURL=TextInput.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput.cjs","names":["useFieldIds","FormField","cn","focusControlOnMouseDown","require_cn","require_Field","require_focusControl","react","react_jsx_runtime","TextInput","describedBy","ariaInvalid","props","ids","id","error","helperText","invalid","prefixId","prefix","className","size","disabled","readOnly","startIcon","endIcon"],"sources":["../../../src/components/TextInput/TextInput.tsx"],"sourcesContent":["import { forwardRef, type InputHTMLAttributes, type ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\nimport { FormField, useFieldIds, type FieldSize, type FormFieldProps } from '../Field';\nimport { focusControlOnMouseDown } from '../Field/focusControl';\nimport './TextInput.css';\n\nexport interface TextInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix'>, FormFieldProps {\n /** Figma \"Size\": `lg` 52px · `md` 46px (default) · `sm` 42px. */\n size?: FieldSize;\n /** Icon before the value (Figma \"Left-icon\"), e.g. `<EmailIcon />` for an email field. Its size follows `size`. */\n startIcon?: ReactNode;\n /** Icon or small action after the value (Figma \"Right-icon\" / \"Both-size-icons\"). */\n endIcon?: ReactNode;\n /** Fixed text in front of the value, e.g. `https://` for a URL field (Figma \"Default-with-disable\"). Not part of the value. */\n prefix?: ReactNode;\n /** Shows the info icon in front of `helperText` (Figma \"With-icon-helper-text\"). */\n helperIcon?: boolean;\n}\n\n/**\n * Figma component set \"Text inputs\" (Type × Size × State) on top of \"Inputs\".\n * Type → native `type` (`text`, `email`, `number`, `url`, …); for passwords use `PasswordInput`.\n * State → native states plus `error`, `disabled`, `readOnly`.\n */\nexport const TextInput = /* @__PURE__ */ forwardRef<HTMLInputElement, TextInputProps>(function TextInput(\n {\n label,\n helperText,\n error,\n required,\n optional,\n size = 'md',\n startIcon,\n endIcon,\n prefix,\n helperIcon,\n id,\n type = 'text',\n disabled,\n readOnly,\n className,\n style,\n 'aria-describedby': describedBy,\n 'aria-invalid': ariaInvalid,\n ...props\n },\n ref,\n) {\n const ids = useFieldIds(id, Boolean(error || helperText));\n const invalid = Boolean(error);\n // The prefix is not part of the value, so it is announced as a description of the control.\n const prefixId = prefix ? `${ids.controlId}-prefix` : undefined;\n\n return (\n <FormField\n ids={ids}\n label={label}\n helperText={helperText}\n error={error}\n required={required}\n optional={optional}\n size={size}\n helperIcon={helperIcon}\n className={cn('tm-text-input', className)}\n style={style}\n >\n <div\n className=\"tm-field\"\n data-size={size}\n data-tm-icon-size={size}\n data-invalid={invalid ? '' : undefined}\n data-disabled={disabled ? '' : undefined}\n data-readonly={readOnly ? '' : undefined}\n onMouseDown={focusControlOnMouseDown}\n >\n {startIcon}\n {prefix ? (\n <span className=\"tm-field__prefix\" id={prefixId}>\n {prefix}\n </span>\n ) : null}\n <input\n ref={ref}\n id={ids.controlId}\n type={type}\n className=\"tm-field__control tm-text-input__control\"\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n aria-invalid={ariaInvalid ?? (invalid || undefined)}\n aria-describedby={[describedBy, prefixId, ids.messageId].filter(Boolean).join(' ') || undefined}\n {...props}\n />\n {endIcon}\n </div>\n </FormField>\n );\n});\n"],"mappings":"A,+MAwBA,IAAaS,GAA4B,EAAAF,EAAA,WAAA,CAA6C,SACpF,CACE,QACA,aACA,QACA,WACA,WACA,OAAO,KACP,YACA,UACA,SACA,aACA,KACA,OAAO,OACP,WACA,WACA,YACA,QACA,mBAAoBG,EACpB,eAAgBC,EAChB,GAAGC,GAEL,EACA,CACA,IAAMC,EAAMb,EAAAA,YAAYc,EAAI,GAAQC,GAASC,EAAW,EAClDC,EAAU,EAAQF,EAElBG,EAAWC,EAAS,GAAGN,EAAI,UAAU,SAAW,IAAA,GAEtD,OACE,EAAAL,EAAA,IAAA,CAACP,EAAAA,UAAD,CACO,MACE,QACK,aACL,QACG,WACA,WACJ,OACM,
|
|
1
|
+
{"version":3,"file":"TextInput.cjs","names":["useFieldIds","FormField","cn","focusControlOnMouseDown","require_cn","require_Field","require_focusControl","react","react_jsx_runtime","TextInput","describedBy","ariaInvalid","props","ids","id","error","helperText","invalid","prefixId","prefix","className","size","disabled","readOnly","startIcon","endIcon"],"sources":["../../../src/components/TextInput/TextInput.tsx"],"sourcesContent":["import { forwardRef, type InputHTMLAttributes, type ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\nimport { FormField, useFieldIds, type FieldErrorAppearanceProps, type FieldSize, type FormFieldProps } from '../Field';\nimport { focusControlOnMouseDown } from '../Field/focusControl';\nimport './TextInput.css';\n\nexport interface TextInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix'>, FormFieldProps, FieldErrorAppearanceProps {\n /** Figma \"Size\": `lg` 52px · `md` 46px (default) · `sm` 42px. */\n size?: FieldSize;\n /** Icon before the value (Figma \"Left-icon\"), e.g. `<EmailIcon />` for an email field. Its size follows `size`. */\n startIcon?: ReactNode;\n /** Icon or small action after the value (Figma \"Right-icon\" / \"Both-size-icons\"). */\n endIcon?: ReactNode;\n /** Fixed text in front of the value, e.g. `https://` for a URL field (Figma \"Default-with-disable\"). Not part of the value. */\n prefix?: ReactNode;\n /** Shows the info icon in front of `helperText` (Figma \"With-icon-helper-text\"). */\n helperIcon?: boolean;\n}\n\n/**\n * Figma component set \"Text inputs\" (Type × Size × State) on top of \"Inputs\".\n * Type → native `type` (`text`, `email`, `number`, `url`, …); for passwords use `PasswordInput`.\n * State → native states plus `error`, `disabled`, `readOnly`.\n */\nexport const TextInput = /* @__PURE__ */ forwardRef<HTMLInputElement, TextInputProps>(function TextInput(\n {\n label,\n helperText,\n error,\n required,\n optional,\n size = 'md',\n startIcon,\n endIcon,\n prefix,\n helperIcon,\n errorColor,\n errorBox,\n id,\n type = 'text',\n disabled,\n readOnly,\n className,\n style,\n 'aria-describedby': describedBy,\n 'aria-invalid': ariaInvalid,\n ...props\n },\n ref,\n) {\n const ids = useFieldIds(id, Boolean(error || helperText));\n const invalid = Boolean(error);\n // The prefix is not part of the value, so it is announced as a description of the control.\n const prefixId = prefix ? `${ids.controlId}-prefix` : undefined;\n\n return (\n <FormField\n ids={ids}\n label={label}\n helperText={helperText}\n error={error}\n required={required}\n optional={optional}\n size={size}\n helperIcon={helperIcon}\n errorColor={errorColor}\n errorBox={errorBox}\n className={cn('tm-text-input', className)}\n style={style}\n >\n <div\n className=\"tm-field\"\n data-size={size}\n data-tm-icon-size={size}\n data-invalid={invalid ? '' : undefined}\n data-disabled={disabled ? '' : undefined}\n data-readonly={readOnly ? '' : undefined}\n onMouseDown={focusControlOnMouseDown}\n >\n {startIcon}\n {prefix ? (\n <span className=\"tm-field__prefix\" id={prefixId}>\n {prefix}\n </span>\n ) : null}\n <input\n ref={ref}\n id={ids.controlId}\n type={type}\n className=\"tm-field__control tm-text-input__control\"\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n aria-invalid={ariaInvalid ?? (invalid || undefined)}\n aria-describedby={[describedBy, prefixId, ids.messageId].filter(Boolean).join(' ') || undefined}\n {...props}\n />\n {endIcon}\n </div>\n </FormField>\n );\n});\n"],"mappings":"A,+MAwBA,IAAaS,GAA4B,EAAAF,EAAA,WAAA,CAA6C,SACpF,CACE,QACA,aACA,QACA,WACA,WACA,OAAO,KACP,YACA,UACA,SACA,aACA,aACA,WACA,KACA,OAAO,OACP,WACA,WACA,YACA,QACA,mBAAoBG,EACpB,eAAgBC,EAChB,GAAGC,GAEL,EACA,CACA,IAAMC,EAAMb,EAAAA,YAAYc,EAAI,GAAQC,GAASC,EAAW,EAClDC,EAAU,EAAQF,EAElBG,EAAWC,EAAS,GAAGN,EAAI,UAAU,SAAW,IAAA,GAEtD,OACE,EAAAL,EAAA,IAAA,CAACP,EAAAA,UAAD,CACO,MACE,QACK,aACL,QACG,WACA,WACJ,OACM,aACA,aACF,WACV,UAAWC,EAAAA,GAAG,gBAAiBkB,CAAS,EACjC,QAEP,UAAA,EAAAZ,EAAA,KAAA,CAAC,MAAD,CACE,UAAU,WACV,YAAWa,EACX,oBAAmBA,EACnB,eAAcJ,EAAU,GAAK,IAAA,GAC7B,gBAAeK,EAAW,GAAK,IAAA,GAC/B,gBAAeC,EAAW,GAAK,IAAA,GAC/B,YAAapB,EAAAA,wBAPf,SAAA,CASGqB,EACAL,GACC,EAAAX,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,mBAAmB,GAAIU,EACpC,SAAAC,CACG,CAAA,EACJ,MACJ,EAAAX,EAAA,IAAA,CAAC,QAAD,CACO,MACL,GAAIK,EAAI,UACF,OACN,UAAU,2CACA,WACA,WACA,WACV,eAAcF,IAAgBM,GAAW,IAAA,IACzC,mBAAkB,CAACP,EAAaQ,EAAUL,EAAI,SAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,GAAK,IAAA,GACtF,GAAID,CACL,CAAA,EACAa,CACE,C,EACI,CAAA,CAEf,CAAC,E"}
|
|
@@ -6,10 +6,10 @@ import { focusControlOnMouseDown as r } from "../Field/focusControl.js";
|
|
|
6
6
|
import { forwardRef as i } from "react";
|
|
7
7
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
8
8
|
// src/components/TextInput/TextInput.tsx
|
|
9
|
-
var s = /* @__PURE__ */ i(function({ label: i, helperText: s, error: c, required: l, optional: u, size: d = "md", startIcon: f, endIcon: p, prefix: m, helperIcon: h,
|
|
10
|
-
let
|
|
9
|
+
var s = /* @__PURE__ */ i(function({ label: i, helperText: s, error: c, required: l, optional: u, size: d = "md", startIcon: f, endIcon: p, prefix: m, helperIcon: h, errorColor: g, errorBox: _, id: v, type: y = "text", disabled: b, readOnly: x, className: S, style: C, "aria-describedby": w, "aria-invalid": T, ...E }, D) {
|
|
10
|
+
let O = n(v, !!(c || s)), k = !!c, A = m ? `${O.controlId}-prefix` : void 0;
|
|
11
11
|
return /* @__PURE__ */ a(t, {
|
|
12
|
-
ids:
|
|
12
|
+
ids: O,
|
|
13
13
|
label: i,
|
|
14
14
|
helperText: s,
|
|
15
15
|
error: c,
|
|
@@ -17,38 +17,40 @@ var s = /* @__PURE__ */ i(function({ label: i, helperText: s, error: c, required
|
|
|
17
17
|
optional: u,
|
|
18
18
|
size: d,
|
|
19
19
|
helperIcon: h,
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
errorColor: g,
|
|
21
|
+
errorBox: _,
|
|
22
|
+
className: e("tm-text-input", S),
|
|
23
|
+
style: C,
|
|
22
24
|
children: /* @__PURE__ */ o("div", {
|
|
23
25
|
className: "tm-field",
|
|
24
26
|
"data-size": d,
|
|
25
27
|
"data-tm-icon-size": d,
|
|
26
|
-
"data-invalid":
|
|
27
|
-
"data-disabled":
|
|
28
|
-
"data-readonly":
|
|
28
|
+
"data-invalid": k ? "" : void 0,
|
|
29
|
+
"data-disabled": b ? "" : void 0,
|
|
30
|
+
"data-readonly": x ? "" : void 0,
|
|
29
31
|
onMouseDown: r,
|
|
30
32
|
children: [
|
|
31
33
|
f,
|
|
32
34
|
m ? /* @__PURE__ */ a("span", {
|
|
33
35
|
className: "tm-field__prefix",
|
|
34
|
-
id:
|
|
36
|
+
id: A,
|
|
35
37
|
children: m
|
|
36
38
|
}) : null,
|
|
37
39
|
/* @__PURE__ */ a("input", {
|
|
38
|
-
ref:
|
|
39
|
-
id:
|
|
40
|
-
type:
|
|
40
|
+
ref: D,
|
|
41
|
+
id: O.controlId,
|
|
42
|
+
type: y,
|
|
41
43
|
className: "tm-field__control tm-text-input__control",
|
|
42
|
-
disabled:
|
|
43
|
-
readOnly:
|
|
44
|
+
disabled: b,
|
|
45
|
+
readOnly: x,
|
|
44
46
|
required: l,
|
|
45
|
-
"aria-invalid":
|
|
47
|
+
"aria-invalid": T ?? (k || void 0),
|
|
46
48
|
"aria-describedby": [
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
w,
|
|
50
|
+
A,
|
|
51
|
+
O.messageId
|
|
50
52
|
].filter(Boolean).join(" ") || void 0,
|
|
51
|
-
...
|
|
53
|
+
...E
|
|
52
54
|
}),
|
|
53
55
|
p
|
|
54
56
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput.js","names":["TextInput","describedBy","ariaInvalid","props","ids","useFieldIds","id","error","helperText","invalid","prefixId","prefix","FormField","cn","className","size","disabled","readOnly","focusControlOnMouseDown","startIcon","endIcon"],"sources":["../../../src/components/TextInput/TextInput.tsx"],"sourcesContent":["import { forwardRef, type InputHTMLAttributes, type ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\nimport { FormField, useFieldIds, type FieldSize, type FormFieldProps } from '../Field';\nimport { focusControlOnMouseDown } from '../Field/focusControl';\nimport './TextInput.css';\n\nexport interface TextInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix'>, FormFieldProps {\n /** Figma \"Size\": `lg` 52px · `md` 46px (default) · `sm` 42px. */\n size?: FieldSize;\n /** Icon before the value (Figma \"Left-icon\"), e.g. `<EmailIcon />` for an email field. Its size follows `size`. */\n startIcon?: ReactNode;\n /** Icon or small action after the value (Figma \"Right-icon\" / \"Both-size-icons\"). */\n endIcon?: ReactNode;\n /** Fixed text in front of the value, e.g. `https://` for a URL field (Figma \"Default-with-disable\"). Not part of the value. */\n prefix?: ReactNode;\n /** Shows the info icon in front of `helperText` (Figma \"With-icon-helper-text\"). */\n helperIcon?: boolean;\n}\n\n/**\n * Figma component set \"Text inputs\" (Type × Size × State) on top of \"Inputs\".\n * Type → native `type` (`text`, `email`, `number`, `url`, …); for passwords use `PasswordInput`.\n * State → native states plus `error`, `disabled`, `readOnly`.\n */\nexport const TextInput = /* @__PURE__ */ forwardRef<HTMLInputElement, TextInputProps>(function TextInput(\n {\n label,\n helperText,\n error,\n required,\n optional,\n size = 'md',\n startIcon,\n endIcon,\n prefix,\n helperIcon,\n id,\n type = 'text',\n disabled,\n readOnly,\n className,\n style,\n 'aria-describedby': describedBy,\n 'aria-invalid': ariaInvalid,\n ...props\n },\n ref,\n) {\n const ids = useFieldIds(id, Boolean(error || helperText));\n const invalid = Boolean(error);\n // The prefix is not part of the value, so it is announced as a description of the control.\n const prefixId = prefix ? `${ids.controlId}-prefix` : undefined;\n\n return (\n <FormField\n ids={ids}\n label={label}\n helperText={helperText}\n error={error}\n required={required}\n optional={optional}\n size={size}\n helperIcon={helperIcon}\n className={cn('tm-text-input', className)}\n style={style}\n >\n <div\n className=\"tm-field\"\n data-size={size}\n data-tm-icon-size={size}\n data-invalid={invalid ? '' : undefined}\n data-disabled={disabled ? '' : undefined}\n data-readonly={readOnly ? '' : undefined}\n onMouseDown={focusControlOnMouseDown}\n >\n {startIcon}\n {prefix ? (\n <span className=\"tm-field__prefix\" id={prefixId}>\n {prefix}\n </span>\n ) : null}\n <input\n ref={ref}\n id={ids.controlId}\n type={type}\n className=\"tm-field__control tm-text-input__control\"\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n aria-invalid={ariaInvalid ?? (invalid || undefined)}\n aria-describedby={[describedBy, prefixId, ids.messageId].filter(Boolean).join(' ') || undefined}\n {...props}\n />\n {endIcon}\n </div>\n </FormField>\n );\n});\n"],"mappings":";;;;;;;;AAwBA,IAAaA,IAA4B,kBAA6C,SACpF,EACE,UACA,eACA,UACA,aACA,aACA,UAAO,MACP,cACA,YACA,WACA,eACA,OACA,UAAO,QACP,aACA,aACA,cACA,UACA,oBAAoBC,GACpB,gBAAgBC,GAChB,GAAGC,KAEL,GACA;CACA,IAAMC,IAAMC,EAAYC,GAAI,GAAQC,KAASC,EAAW,GAClDC,IAAU,EAAQF,GAElBG,IAAWC,IAAS,GAAGP,EAAI,UAAU,WAAW,KAAA;CAEtD,OACE,kBAACQ,GAAD;EACO;EACE;EACK;EACL;EACG;EACA;EACJ;EACM;
|
|
1
|
+
{"version":3,"file":"TextInput.js","names":["TextInput","describedBy","ariaInvalid","props","ids","useFieldIds","id","error","helperText","invalid","prefixId","prefix","FormField","cn","className","size","disabled","readOnly","focusControlOnMouseDown","startIcon","endIcon"],"sources":["../../../src/components/TextInput/TextInput.tsx"],"sourcesContent":["import { forwardRef, type InputHTMLAttributes, type ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\nimport { FormField, useFieldIds, type FieldErrorAppearanceProps, type FieldSize, type FormFieldProps } from '../Field';\nimport { focusControlOnMouseDown } from '../Field/focusControl';\nimport './TextInput.css';\n\nexport interface TextInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix'>, FormFieldProps, FieldErrorAppearanceProps {\n /** Figma \"Size\": `lg` 52px · `md` 46px (default) · `sm` 42px. */\n size?: FieldSize;\n /** Icon before the value (Figma \"Left-icon\"), e.g. `<EmailIcon />` for an email field. Its size follows `size`. */\n startIcon?: ReactNode;\n /** Icon or small action after the value (Figma \"Right-icon\" / \"Both-size-icons\"). */\n endIcon?: ReactNode;\n /** Fixed text in front of the value, e.g. `https://` for a URL field (Figma \"Default-with-disable\"). Not part of the value. */\n prefix?: ReactNode;\n /** Shows the info icon in front of `helperText` (Figma \"With-icon-helper-text\"). */\n helperIcon?: boolean;\n}\n\n/**\n * Figma component set \"Text inputs\" (Type × Size × State) on top of \"Inputs\".\n * Type → native `type` (`text`, `email`, `number`, `url`, …); for passwords use `PasswordInput`.\n * State → native states plus `error`, `disabled`, `readOnly`.\n */\nexport const TextInput = /* @__PURE__ */ forwardRef<HTMLInputElement, TextInputProps>(function TextInput(\n {\n label,\n helperText,\n error,\n required,\n optional,\n size = 'md',\n startIcon,\n endIcon,\n prefix,\n helperIcon,\n errorColor,\n errorBox,\n id,\n type = 'text',\n disabled,\n readOnly,\n className,\n style,\n 'aria-describedby': describedBy,\n 'aria-invalid': ariaInvalid,\n ...props\n },\n ref,\n) {\n const ids = useFieldIds(id, Boolean(error || helperText));\n const invalid = Boolean(error);\n // The prefix is not part of the value, so it is announced as a description of the control.\n const prefixId = prefix ? `${ids.controlId}-prefix` : undefined;\n\n return (\n <FormField\n ids={ids}\n label={label}\n helperText={helperText}\n error={error}\n required={required}\n optional={optional}\n size={size}\n helperIcon={helperIcon}\n errorColor={errorColor}\n errorBox={errorBox}\n className={cn('tm-text-input', className)}\n style={style}\n >\n <div\n className=\"tm-field\"\n data-size={size}\n data-tm-icon-size={size}\n data-invalid={invalid ? '' : undefined}\n data-disabled={disabled ? '' : undefined}\n data-readonly={readOnly ? '' : undefined}\n onMouseDown={focusControlOnMouseDown}\n >\n {startIcon}\n {prefix ? (\n <span className=\"tm-field__prefix\" id={prefixId}>\n {prefix}\n </span>\n ) : null}\n <input\n ref={ref}\n id={ids.controlId}\n type={type}\n className=\"tm-field__control tm-text-input__control\"\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n aria-invalid={ariaInvalid ?? (invalid || undefined)}\n aria-describedby={[describedBy, prefixId, ids.messageId].filter(Boolean).join(' ') || undefined}\n {...props}\n />\n {endIcon}\n </div>\n </FormField>\n );\n});\n"],"mappings":";;;;;;;;AAwBA,IAAaA,IAA4B,kBAA6C,SACpF,EACE,UACA,eACA,UACA,aACA,aACA,UAAO,MACP,cACA,YACA,WACA,eACA,eACA,aACA,OACA,UAAO,QACP,aACA,aACA,cACA,UACA,oBAAoBC,GACpB,gBAAgBC,GAChB,GAAGC,KAEL,GACA;CACA,IAAMC,IAAMC,EAAYC,GAAI,GAAQC,KAASC,EAAW,GAClDC,IAAU,EAAQF,GAElBG,IAAWC,IAAS,GAAGP,EAAI,UAAU,WAAW,KAAA;CAEtD,OACE,kBAACQ,GAAD;EACO;EACE;EACK;EACL;EACG;EACA;EACJ;EACM;EACA;EACF;EACV,WAAWC,EAAG,iBAAiBC,CAAS;EACjC;EAEP,UAAA,kBAAC,OAAD;GACE,WAAU;GACV,aAAWC;GACX,qBAAmBA;GACnB,gBAAcN,IAAU,KAAK,KAAA;GAC7B,iBAAeO,IAAW,KAAK,KAAA;GAC/B,iBAAeC,IAAW,KAAK,KAAA;GAC/B,aAAaC;GAPf,UAAA;IASGC;IACAR,IACC,kBAAC,QAAD;KAAM,WAAU;KAAmB,IAAID;KACpC,UAAAC;IACG,CAAA,IACJ;IACJ,kBAAC,SAAD;KACO;KACL,IAAIP,EAAI;KACF;KACN,WAAU;KACA;KACA;KACA;KACV,gBAAcF,MAAgBO,KAAW,KAAA;KACzC,oBAAkB;MAACR;MAAaS;MAAUN,EAAI;KAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,KAAK,KAAA;KACtF,GAAID;IACL,CAAA;IACAiB;GACE;;CACI,CAAA;AAEf,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";const e=require("../../icons/generated/ResizeFieldIcon.cjs"),t=require("../../utils/cn.cjs"),n=require("../Field/Field.cjs"),r=require("../Field/focusControl.cjs");;/* empty css */let i=require("react"),a=require("react/jsx-runtime");function o(e){let t=e.currentTarget,n=t.parentElement?.querySelector(`.tm-field__control`);if(!n||e.button!==0)return;e.preventDefault();let r=e.clientY,i=n.getBoundingClientRect().height,a=e=>{n.style.height=`${Math.max(0,i+e.clientY-r)}px`},o=()=>{t.removeEventListener(`pointermove`,a),t.removeEventListener(`pointerup`,o),t.removeEventListener(`pointercancel`,o)};t.setPointerCapture?.(e.pointerId),t.addEventListener(`pointermove`,a),t.addEventListener(`pointerup`,o),t.addEventListener(`pointercancel`,o)}var s=(0,i.forwardRef)(function({label:i,helperText:s,error:c,required:l,optional:u,size:d=`md`,resizable:f=!0,helperIcon:p,
|
|
1
|
+
"use client";const e=require("../../icons/generated/ResizeFieldIcon.cjs"),t=require("../../utils/cn.cjs"),n=require("../Field/Field.cjs"),r=require("../Field/focusControl.cjs");;/* empty css */let i=require("react"),a=require("react/jsx-runtime");function o(e){let t=e.currentTarget,n=t.parentElement?.querySelector(`.tm-field__control`);if(!n||e.button!==0)return;e.preventDefault();let r=e.clientY,i=n.getBoundingClientRect().height,a=e=>{n.style.height=`${Math.max(0,i+e.clientY-r)}px`},o=()=>{t.removeEventListener(`pointermove`,a),t.removeEventListener(`pointerup`,o),t.removeEventListener(`pointercancel`,o)};t.setPointerCapture?.(e.pointerId),t.addEventListener(`pointermove`,a),t.addEventListener(`pointerup`,o),t.addEventListener(`pointercancel`,o)}var s=(0,i.forwardRef)(function({label:i,helperText:s,error:c,required:l,optional:u,size:d=`md`,resizable:f=!0,helperIcon:p,errorColor:m,errorBox:h,id:g,disabled:_,readOnly:v,className:y,style:b,"aria-describedby":x,"aria-invalid":S,...C},w){let T=n.useFieldIds(g,!!(c||s)),E=!!c;return(0,a.jsx)(n.FormField,{ids:T,label:i,helperText:s,error:c,required:l,optional:u,size:d,helperIcon:p,errorColor:m,errorBox:h,className:t.cn(`tm-textarea`,y),style:b,children:(0,a.jsxs)(`div`,{className:`tm-field tm-textarea__box`,"data-size":d,"data-tm-icon-size":d,"data-invalid":E?``:void 0,"data-disabled":_?``:void 0,"data-readonly":v?``:void 0,onMouseDown:r.focusControlOnMouseDown,children:[(0,a.jsx)(`textarea`,{ref:w,id:T.controlId,className:`tm-field__control tm-textarea__control`,disabled:_,readOnly:v,required:l,"aria-invalid":S??(E||void 0),"aria-describedby":[x,T.messageId].filter(Boolean).join(` `)||void 0,...C}),f?(0,a.jsx)(`span`,{className:`tm-textarea__resize`,"aria-hidden":`true`,onPointerDown:_?void 0:o,children:(0,a.jsx)(e.ResizeFieldIcon,{})}):null]})})});exports.Textarea=s;
|
|
2
2
|
//# sourceMappingURL=Textarea.cjs.map
|