@namroodinc/liquid-editorial 0.1.5 → 0.1.7
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/AGENTS.md +2 -0
- package/README.md +149 -4
- package/UPGRADING.md +127 -4
- package/dist/components/AppShell/index.cjs +2 -0
- package/dist/components/AppShell/index.cjs.map +1 -0
- package/dist/components/AppShell/index.d.cts +15 -0
- package/dist/components/AppShell/index.d.cts.map +1 -0
- package/dist/components/AppShell/index.d.ts +15 -0
- package/dist/components/AppShell/index.d.ts.map +1 -0
- package/dist/components/AppShell/index.js +93 -0
- package/dist/components/AppShell/index.js.map +1 -0
- package/dist/components/AppShell/style.css +79 -0
- package/dist/components/AssetGrid/index.cjs +1 -1
- package/dist/components/AssetGrid/index.cjs.map +1 -1
- package/dist/components/AssetGrid/index.d.cts.map +1 -1
- package/dist/components/AssetGrid/index.d.ts.map +1 -1
- package/dist/components/AssetGrid/index.js +57 -59
- package/dist/components/AssetGrid/index.js.map +1 -1
- package/dist/components/AssetGrid/style.css +8 -16
- package/dist/components/Board/index.cjs +1 -1
- package/dist/components/Board/index.cjs.map +1 -1
- package/dist/components/Board/index.d.cts.map +1 -1
- package/dist/components/Board/index.d.ts.map +1 -1
- package/dist/components/Board/index.js +88 -84
- package/dist/components/Board/index.js.map +1 -1
- package/dist/components/Board/style.css +17 -28
- package/dist/components/Button/index.cjs +1 -1
- package/dist/components/Button/index.cjs.map +1 -1
- package/dist/components/Button/index.d.cts +3 -2
- package/dist/components/Button/index.d.cts.map +1 -1
- package/dist/components/Button/index.d.ts +3 -2
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.js +1 -1
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Button/style.css +21 -15
- package/dist/components/DatePicker/index.cjs +1 -1
- package/dist/components/DatePicker/index.cjs.map +1 -1
- package/dist/components/DatePicker/index.d.cts.map +1 -1
- package/dist/components/DatePicker/index.d.ts.map +1 -1
- package/dist/components/DatePicker/index.js +46 -45
- package/dist/components/DatePicker/index.js.map +1 -1
- package/dist/components/DatePicker/style.css +4 -61
- package/dist/components/Drawer/index.cjs +1 -1
- package/dist/components/Drawer/index.cjs.map +1 -1
- package/dist/components/Drawer/index.d.cts +10 -1
- package/dist/components/Drawer/index.d.cts.map +1 -1
- package/dist/components/Drawer/index.d.ts +10 -1
- package/dist/components/Drawer/index.d.ts.map +1 -1
- package/dist/components/Drawer/index.js +69 -47
- package/dist/components/Drawer/index.js.map +1 -1
- package/dist/components/Drawer/style.css +106 -0
- package/dist/components/EntryPicker/index.cjs +1 -1
- package/dist/components/EntryPicker/index.cjs.map +1 -1
- package/dist/components/EntryPicker/index.d.cts.map +1 -1
- package/dist/components/EntryPicker/index.d.ts.map +1 -1
- package/dist/components/EntryPicker/index.js +12 -11
- package/dist/components/EntryPicker/index.js.map +1 -1
- package/dist/components/EntryPicker/style.css +3 -30
- package/dist/components/Field/style.css +11 -3
- package/dist/components/ImageCropper/index.cjs +1 -1
- package/dist/components/ImageCropper/index.cjs.map +1 -1
- package/dist/components/ImageCropper/index.d.cts +3 -17
- package/dist/components/ImageCropper/index.d.cts.map +1 -1
- package/dist/components/ImageCropper/index.d.ts +3 -17
- package/dist/components/ImageCropper/index.d.ts.map +1 -1
- package/dist/components/ImageCropper/index.js +143 -180
- package/dist/components/ImageCropper/index.js.map +1 -1
- package/dist/components/ImageCropper/style.css +2 -94
- package/dist/components/Menu/index.cjs +1 -1
- package/dist/components/Menu/index.cjs.map +1 -1
- package/dist/components/Menu/index.d.cts.map +1 -1
- package/dist/components/Menu/index.d.ts.map +1 -1
- package/dist/components/Menu/index.js +11 -16
- package/dist/components/Menu/index.js.map +1 -1
- package/dist/components/Menu/style.css +7 -41
- package/dist/components/Modal/index.cjs +1 -1
- package/dist/components/Modal/index.cjs.map +1 -1
- package/dist/components/Modal/index.d.cts.map +1 -1
- package/dist/components/Modal/index.d.ts.map +1 -1
- package/dist/components/Modal/index.js +12 -12
- package/dist/components/Modal/index.js.map +1 -1
- package/dist/components/NumberField/index.cjs +1 -1
- package/dist/components/NumberField/index.cjs.map +1 -1
- package/dist/components/NumberField/index.js +13 -17
- package/dist/components/NumberField/index.js.map +1 -1
- package/dist/components/NumberField/style.css +1 -41
- package/dist/components/Pagination/index.cjs +2 -0
- package/dist/components/Pagination/index.cjs.map +1 -0
- package/dist/components/Pagination/index.d.cts +24 -0
- package/dist/components/Pagination/index.d.cts.map +1 -0
- package/dist/components/Pagination/index.d.ts +24 -0
- package/dist/components/Pagination/index.d.ts.map +1 -0
- package/dist/components/Pagination/index.js +96 -0
- package/dist/components/Pagination/index.js.map +1 -0
- package/dist/components/Pagination/style.css +52 -0
- package/dist/components/Popover/index.cjs +1 -1
- package/dist/components/Popover/index.cjs.map +1 -1
- package/dist/components/Popover/index.d.cts +5 -1
- package/dist/components/Popover/index.d.cts.map +1 -1
- package/dist/components/Popover/index.d.ts +5 -1
- package/dist/components/Popover/index.d.ts.map +1 -1
- package/dist/components/Popover/index.js +27 -26
- package/dist/components/Popover/index.js.map +1 -1
- package/dist/components/SearchField/index.cjs +1 -1
- package/dist/components/SearchField/index.cjs.map +1 -1
- package/dist/components/SearchField/index.d.cts.map +1 -1
- package/dist/components/SearchField/index.d.ts.map +1 -1
- package/dist/components/SearchField/index.js +26 -27
- package/dist/components/SearchField/index.js.map +1 -1
- package/dist/components/SearchField/style.css +0 -21
- package/dist/components/Select/index.cjs +1 -1
- package/dist/components/Select/index.cjs.map +1 -1
- package/dist/components/Select/index.d.cts +3 -0
- package/dist/components/Select/index.d.cts.map +1 -1
- package/dist/components/Select/index.d.ts +3 -0
- package/dist/components/Select/index.d.ts.map +1 -1
- package/dist/components/Select/index.js +82 -73
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/Select/style.css +5 -38
- package/dist/components/SideNav/index.cjs +1 -1
- package/dist/components/SideNav/index.cjs.map +1 -1
- package/dist/components/SideNav/index.d.cts.map +1 -1
- package/dist/components/SideNav/index.d.ts.map +1 -1
- package/dist/components/SideNav/index.js +52 -49
- package/dist/components/SideNav/index.js.map +1 -1
- package/dist/components/SideNav/style.css +2 -27
- package/dist/components/Slider/style.css +14 -5
- package/dist/components/SortableList/index.cjs +1 -1
- package/dist/components/SortableList/index.cjs.map +1 -1
- package/dist/components/SortableList/index.d.cts.map +1 -1
- package/dist/components/SortableList/index.d.ts.map +1 -1
- package/dist/components/SortableList/index.js +42 -39
- package/dist/components/SortableList/index.js.map +1 -1
- package/dist/components/SortableList/style.css +9 -15
- package/dist/components/Stepper/index.cjs +1 -1
- package/dist/components/Stepper/index.cjs.map +1 -1
- package/dist/components/Stepper/index.d.cts.map +1 -1
- package/dist/components/Stepper/index.d.ts.map +1 -1
- package/dist/components/Stepper/index.js +48 -39
- package/dist/components/Stepper/index.js.map +1 -1
- package/dist/components/Stepper/style.css +24 -18
- package/dist/components/SubNav/index.cjs +1 -1
- package/dist/components/SubNav/index.cjs.map +1 -1
- package/dist/components/SubNav/index.d.cts.map +1 -1
- package/dist/components/SubNav/index.d.ts.map +1 -1
- package/dist/components/SubNav/index.js +27 -28
- package/dist/components/SubNav/index.js.map +1 -1
- package/dist/components/SubNav/style.css +13 -0
- package/dist/components/Switch/index.cjs +1 -1
- package/dist/components/Switch/index.cjs.map +1 -1
- package/dist/components/Switch/index.d.cts.map +1 -1
- package/dist/components/Switch/index.d.ts.map +1 -1
- package/dist/components/Switch/index.js +23 -21
- package/dist/components/Switch/index.js.map +1 -1
- package/dist/components/Switch/style.css +2 -28
- package/dist/components/TagsInput/index.cjs +1 -1
- package/dist/components/TagsInput/index.cjs.map +1 -1
- package/dist/components/TagsInput/index.js +8 -10
- package/dist/components/TagsInput/index.js.map +1 -1
- package/dist/components/TagsInput/style.css +2 -24
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +7 -3
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +7 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +36 -34
- package/dist/styles.css +2 -0
- package/package.json +1 -1
|
@@ -31,47 +31,7 @@
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
.ds-number__step {
|
|
35
|
-
display: grid;
|
|
36
|
-
place-items: center;
|
|
37
|
-
flex: none;
|
|
38
|
-
inline-size: var(--field-height-md);
|
|
39
|
-
block-size: var(--field-height-md);
|
|
40
|
-
border: var(--control-border-width) solid var(--control-border-color);
|
|
41
|
-
border-radius: var(--field-radius);
|
|
42
|
-
background: var(--field-rest);
|
|
43
|
-
color: var(--color-text);
|
|
44
|
-
cursor: pointer;
|
|
45
|
-
transition: background-color var(--duration-fast) var(--ease-standard);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.ds-number[data-size="sm"] .ds-number__step {
|
|
49
|
-
inline-size: var(--field-height-sm);
|
|
50
|
-
block-size: var(--field-height-sm);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.ds-number[data-size="lg"] .ds-number__step {
|
|
54
|
-
inline-size: var(--field-height-lg);
|
|
55
|
-
block-size: var(--field-height-lg);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.ds-number__step:hover:not(:disabled) {
|
|
59
|
-
background: var(--field-hover);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.ds-number__step:active:not(:disabled) {
|
|
63
|
-
background: var(--field-pressed);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.ds-number__step:focus-visible {
|
|
67
|
-
outline: var(--control-border-width) solid var(--color-focus);
|
|
68
|
-
outline-offset: 2px;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.ds-number__step:disabled {
|
|
72
|
-
opacity: 45%;
|
|
73
|
-
cursor: not-allowed;
|
|
74
|
-
}
|
|
34
|
+
.ds-number__step { flex: none; }
|
|
75
35
|
|
|
76
36
|
.ds-number-range {
|
|
77
37
|
display: flex;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../Button/index.cjs"),t=require("../Select/index.cjs");let n=require("react"),r=require("react/jsx-runtime");var i=(0,n.forwardRef)(function({totalResults:i,page:a,pageSize:o,onChange:s,pageSizeOptions:c=[10,25,50,100],size:l=`sm`,isDisabled:u=!1,showLabels:d=!0,menuPlacement:f=`bottom`,className:p,...m},h){let g=(0,n.useId)(),_=Math.max(1,Math.ceil(i/o)),v=Math.min(Math.max(1,a),_),y=u||i===0,b=y||v===1,x=y||v===_,S=(v-1)*o+1,C=Math.min(v*o,i),w=e=>{let t=Math.min(Math.max(1,e),_);t!==v&&s({page:t,pageSize:o})};return(0,r.jsxs)(`nav`,{ref:h,"aria-label":`Pagination`,"data-size":l,className:[`ds-pagination`,p].filter(Boolean).join(` `),...m,children:[(0,r.jsx)(`div`,{className:`ds-pagination__actions`,children:(0,r.jsx)(e.Button,{variant:`neutral`,size:l,iconStart:`chevron-left`,isIconOnly:!d,"aria-label":`Previous page`,isDisabled:b,onClick:()=>w(v-1),children:`Previous`})}),(0,r.jsxs)(`div`,{className:`ds-pagination__centre`,children:[(0,r.jsxs)(`div`,{className:`ds-pagination__per-page`,children:[(0,r.jsx)(`span`,{id:g,children:`Per page`}),(0,r.jsx)(`div`,{className:`ds-pagination__select`,children:(0,r.jsx)(t.Select,{"aria-labelledby":g,value:String(o),options:c.map(e=>({value:String(e),label:String(e)})),size:l,menuPlacement:f,isDisabled:y||i<=Math.min(...c),onValueChange:e=>{let t=Number(e);if(t===o)return;let n=Math.floor((v-1)*o/t)+1,r=Math.max(1,Math.ceil(i/t));s({page:Math.min(n,r),pageSize:t})}})})]}),(0,r.jsx)(`span`,{className:`ds-pagination__range`,"aria-live":`polite`,"aria-atomic":`true`,children:i===0?`No results`:`${S.toLocaleString(`en-US`)}–${C.toLocaleString(`en-US`)} of ${i.toLocaleString(`en-US`)}`})]}),(0,r.jsx)(`div`,{className:`ds-pagination__actions ds-pagination__actions--next`,children:(0,r.jsx)(e.Button,{variant:`neutral`,size:l,iconStart:d?void 0:`chevron-right`,iconEnd:d?`chevron-right`:void 0,isIconOnly:!d,"aria-label":`Next page`,isDisabled:x,onClick:()=>w(v+1),children:`Next`})})]})});exports.Pagination=i;
|
|
2
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["forwardRef","useId","Button","Select","require_components_Button_index","require_components_Select_index","react","react_jsx_runtime","Pagination","rest","labelId","pageCount","totalResults","pageSize","currentPage","page","disabled","isDisabled","atStart","atEnd","start","end","go","next","nextPage","onChange","size","className","showLabels","pageSizeOptions","value","nextSize","nextPageCount"],"sources":["../../../src/components/Pagination/index.tsx"],"sourcesContent":["import { forwardRef, useId, type HTMLAttributes } from \"react\";\nimport { Button } from \"../Button\";\nimport { Select } from \"../Select\";\nimport type { PopoverPlacement } from \"../Popover\";\nimport \"./style.css\";\n\nexport type PaginationSize = \"sm\" | \"md\";\n\nexport interface PaginationState {\n /** One-based page number. */\n page: number;\n /** Positive integer results per page. */\n pageSize: number;\n}\n\nexport interface PaginationProps\n extends\n Omit<HTMLAttributes<HTMLElement>, \"children\" | \"onChange\">,\n PaginationState {\n /** Total number of matching results, before pagination. */\n totalResults: number;\n /** Emitted once per user change, with both values ready to apply together. */\n onChange: (next: PaginationState) => void;\n /** Nonempty list of positive integers containing the current pageSize. */\n pageSizeOptions?: number[];\n size?: PaginationSize;\n isDisabled?: boolean;\n showLabels?: boolean;\n menuPlacement?: PopoverPlacement;\n}\n\n/** Controlled navigation for a result set. Data loading and slicing belong to the application. */\nexport const Pagination = forwardRef<HTMLElement, PaginationProps>(\n function Pagination(\n {\n totalResults,\n page,\n pageSize,\n onChange,\n pageSizeOptions = [10, 25, 50, 100],\n size = \"sm\",\n isDisabled = false,\n showLabels = true,\n menuPlacement = \"bottom\",\n className,\n ...rest\n },\n ref,\n ) {\n const labelId = useId();\n const pageCount = Math.max(1, Math.ceil(totalResults / pageSize));\n const currentPage = Math.min(Math.max(1, page), pageCount);\n const disabled = isDisabled || totalResults === 0;\n const atStart = disabled || currentPage === 1;\n const atEnd = disabled || currentPage === pageCount;\n const start = (currentPage - 1) * pageSize + 1;\n const end = Math.min(currentPage * pageSize, totalResults);\n\n const go = (nextPage: number) => {\n const next = Math.min(Math.max(1, nextPage), pageCount);\n if (next !== currentPage) onChange({ page: next, pageSize });\n };\n\n return (\n <nav\n ref={ref}\n aria-label=\"Pagination\"\n data-size={size}\n className={[\"ds-pagination\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n <div className=\"ds-pagination__actions\">\n <Button\n variant=\"neutral\"\n size={size}\n iconStart=\"chevron-left\"\n isIconOnly={!showLabels}\n aria-label=\"Previous page\"\n isDisabled={atStart}\n onClick={() => go(currentPage - 1)}\n >\n Previous\n </Button>\n </div>\n\n <div className=\"ds-pagination__centre\">\n <div className=\"ds-pagination__per-page\">\n <span id={labelId}>Per page</span>\n <div className=\"ds-pagination__select\">\n <Select\n aria-labelledby={labelId}\n value={String(pageSize)}\n options={pageSizeOptions.map((value) => ({\n value: String(value),\n label: String(value),\n }))}\n size={size}\n menuPlacement={menuPlacement}\n isDisabled={\n disabled || totalResults <= Math.min(...pageSizeOptions)\n }\n onValueChange={(value) => {\n const nextSize = Number(value);\n if (nextSize === pageSize) return;\n const nextPage =\n Math.floor(((currentPage - 1) * pageSize) / nextSize) + 1;\n const nextPageCount = Math.max(\n 1,\n Math.ceil(totalResults / nextSize),\n );\n onChange({\n page: Math.min(nextPage, nextPageCount),\n pageSize: nextSize,\n });\n }}\n />\n </div>\n </div>\n <span\n className=\"ds-pagination__range\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n {totalResults === 0\n ? \"No results\"\n : `${start.toLocaleString(\"en-US\")}–${end.toLocaleString(\"en-US\")} of ${totalResults.toLocaleString(\"en-US\")}`}\n </span>\n </div>\n\n <div className=\"ds-pagination__actions ds-pagination__actions--next\">\n <Button\n variant=\"neutral\"\n size={size}\n iconStart={showLabels ? undefined : \"chevron-right\"}\n iconEnd={showLabels ? \"chevron-right\" : undefined}\n isIconOnly={!showLabels}\n aria-label=\"Next page\"\n isDisabled={atEnd}\n onClick={() => go(currentPage + 1)}\n >\n Next\n </Button>\n </div>\n </nav>\n );\n },\n);\n"],"mappings":"A,iMAgCA,IAAaQ,GAAA,EAAaR,EAAAA,WAAAA,CACxB,SACE,CACE,eACA,OACA,WACA,WACA,kBAAkB,CAAC,GAAI,GAAI,GAAI,GAAG,EAClC,OAAO,KACP,aAAa,GACb,aAAa,GACb,gBAAgB,SAChB,YACA,GAAGS,GAEL,EACA,CACA,IAAMC,GAAA,EAAUT,EAAAA,MAAAA,CAAM,EAChBU,EAAY,KAAK,IAAI,EAAG,KAAK,KAAKC,EAAeC,CAAQ,CAAC,EAC1DC,EAAc,KAAK,IAAI,KAAK,IAAI,EAAGC,CAAI,EAAGJ,CAAS,EACnDK,EAAWC,GAAcL,IAAiB,EAC1CM,EAAUF,GAAYF,IAAgB,EACtCK,EAAQH,GAAYF,IAAgBH,EACpCS,GAASN,EAAc,GAAKD,EAAW,EACvCQ,EAAM,KAAK,IAAIP,EAAcD,EAAUD,CAAY,EAEnDU,EAAM,GAAqB,CAC/B,IAAMC,EAAO,KAAK,IAAI,KAAK,IAAI,EAAGC,CAAQ,EAAGb,CAAS,EAClDY,IAAST,GAAaW,EAAS,CAAE,KAAMF,EAAM,UAAS,CAAC,CAC7D,EAEA,OACE,EAAAhB,EAAA,KAAA,CAAC,MAAD,CACO,MACL,aAAW,aACX,YAAWmB,EACX,UAAW,CAAC,gBAAiBC,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,EAChE,GAAIlB,EALN,SAAA,EAOE,EAAAF,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,yBACb,UAAA,EAAAA,EAAA,IAAA,CAACL,EAAAA,OAAD,CACE,QAAQ,UACF,OACN,UAAU,eACV,WAAY,CAAC0B,EACb,aAAW,gBACX,WAAYV,EACZ,YAAeI,EAAGR,EA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gBACpC,QAASA,EAAa,gBAAkB,IAAA,GACxC,WAAY,CAACA,EACb,aAAW,YACX,WAAYT,EACZ,YAAeG,EAAGR,EAAc,CAAC,EAClC,SAAA,MAEO,CAAA,CACL,CAAA,CACF,C,EAET,CACF,E"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type HTMLAttributes } from "react";
|
|
2
|
+
import type { PopoverPlacement } from "../Popover/index.cjs";
|
|
3
|
+
export type PaginationSize = "sm" | "md";
|
|
4
|
+
export interface PaginationState {
|
|
5
|
+
/** One-based page number. */
|
|
6
|
+
page: number;
|
|
7
|
+
/** Positive integer results per page. */
|
|
8
|
+
pageSize: number;
|
|
9
|
+
}
|
|
10
|
+
export interface PaginationProps extends Omit<HTMLAttributes<HTMLElement>, "children" | "onChange">, PaginationState {
|
|
11
|
+
/** Total number of matching results, before pagination. */
|
|
12
|
+
totalResults: number;
|
|
13
|
+
/** Emitted once per user change, with both values ready to apply together. */
|
|
14
|
+
onChange: (next: PaginationState) => void;
|
|
15
|
+
/** Nonempty list of positive integers containing the current pageSize. */
|
|
16
|
+
pageSizeOptions?: number[];
|
|
17
|
+
size?: PaginationSize;
|
|
18
|
+
isDisabled?: boolean;
|
|
19
|
+
showLabels?: boolean;
|
|
20
|
+
menuPlacement?: PopoverPlacement;
|
|
21
|
+
}
|
|
22
|
+
/** Controlled navigation for a result set. Data loading and slicing belong to the application. */
|
|
23
|
+
export declare const Pagination: import("react").ForwardRefExoticComponent<PaginationProps & import("react").RefAttributes<HTMLElement>>;
|
|
24
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Pagination/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAG/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,aAAa,CAAC;AAErB,MAAM,MAAM,cAAc,GAAG,IAAI,GAAG,IAAI,CAAC;AAEzC,MAAM,WAAW,eAAe;IAC9B,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,eACf,SACE,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC,EAC1D,eAAe;IACjB,2DAA2D;IAC3D,YAAY,EAAE,MAAM,CAAC;IACrB,8EAA8E;IAC9E,QAAQ,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;IAC1C,0EAA0E;IAC1E,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,gBAAgB,CAAC;CAClC;AAED,kGAAkG;AAClG,eAAO,MAAM,UAAU,yGAkHtB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type HTMLAttributes } from "react";
|
|
2
|
+
import type { PopoverPlacement } from "../Popover/index.js";
|
|
3
|
+
export type PaginationSize = "sm" | "md";
|
|
4
|
+
export interface PaginationState {
|
|
5
|
+
/** One-based page number. */
|
|
6
|
+
page: number;
|
|
7
|
+
/** Positive integer results per page. */
|
|
8
|
+
pageSize: number;
|
|
9
|
+
}
|
|
10
|
+
export interface PaginationProps extends Omit<HTMLAttributes<HTMLElement>, "children" | "onChange">, PaginationState {
|
|
11
|
+
/** Total number of matching results, before pagination. */
|
|
12
|
+
totalResults: number;
|
|
13
|
+
/** Emitted once per user change, with both values ready to apply together. */
|
|
14
|
+
onChange: (next: PaginationState) => void;
|
|
15
|
+
/** Nonempty list of positive integers containing the current pageSize. */
|
|
16
|
+
pageSizeOptions?: number[];
|
|
17
|
+
size?: PaginationSize;
|
|
18
|
+
isDisabled?: boolean;
|
|
19
|
+
showLabels?: boolean;
|
|
20
|
+
menuPlacement?: PopoverPlacement;
|
|
21
|
+
}
|
|
22
|
+
/** Controlled navigation for a result set. Data loading and slicing belong to the application. */
|
|
23
|
+
export declare const Pagination: import("react").ForwardRefExoticComponent<PaginationProps & import("react").RefAttributes<HTMLElement>>;
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Pagination/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAG/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,aAAa,CAAC;AAErB,MAAM,MAAM,cAAc,GAAG,IAAI,GAAG,IAAI,CAAC;AAEzC,MAAM,WAAW,eAAe;IAC9B,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,eACf,SACE,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC,EAC1D,eAAe;IACjB,2DAA2D;IAC3D,YAAY,EAAE,MAAM,CAAC;IACrB,8EAA8E;IAC9E,QAAQ,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;IAC1C,0EAA0E;IAC1E,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,gBAAgB,CAAC;CAClC;AAED,kGAAkG;AAClG,eAAO,MAAM,UAAU,yGAkHtB,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { Button as e } from "../Button/index.js";
|
|
2
|
+
import { Select as t } from "../Select/index.js";
|
|
3
|
+
import { forwardRef as n, useId as r } from "react";
|
|
4
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/Pagination/index.tsx
|
|
6
|
+
var o = n(function({ totalResults: n, page: o, pageSize: s, onChange: c, pageSizeOptions: l = [
|
|
7
|
+
10,
|
|
8
|
+
25,
|
|
9
|
+
50,
|
|
10
|
+
100
|
|
11
|
+
], size: u = "sm", isDisabled: d = !1, showLabels: f = !0, menuPlacement: p = "bottom", className: m, ...h }, g) {
|
|
12
|
+
let _ = r(), v = Math.max(1, Math.ceil(n / s)), y = Math.min(Math.max(1, o), v), b = d || n === 0, x = b || y === 1, S = b || y === v, C = (y - 1) * s + 1, w = Math.min(y * s, n), T = (e) => {
|
|
13
|
+
let t = Math.min(Math.max(1, e), v);
|
|
14
|
+
t !== y && c({
|
|
15
|
+
page: t,
|
|
16
|
+
pageSize: s
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
return /* @__PURE__ */ a("nav", {
|
|
20
|
+
ref: g,
|
|
21
|
+
"aria-label": "Pagination",
|
|
22
|
+
"data-size": u,
|
|
23
|
+
className: ["ds-pagination", m].filter(Boolean).join(" "),
|
|
24
|
+
...h,
|
|
25
|
+
children: [
|
|
26
|
+
/* @__PURE__ */ i("div", {
|
|
27
|
+
className: "ds-pagination__actions",
|
|
28
|
+
children: /* @__PURE__ */ i(e, {
|
|
29
|
+
variant: "neutral",
|
|
30
|
+
size: u,
|
|
31
|
+
iconStart: "chevron-left",
|
|
32
|
+
isIconOnly: !f,
|
|
33
|
+
"aria-label": "Previous page",
|
|
34
|
+
isDisabled: x,
|
|
35
|
+
onClick: () => T(y - 1),
|
|
36
|
+
children: "Previous"
|
|
37
|
+
})
|
|
38
|
+
}),
|
|
39
|
+
/* @__PURE__ */ a("div", {
|
|
40
|
+
className: "ds-pagination__centre",
|
|
41
|
+
children: [/* @__PURE__ */ a("div", {
|
|
42
|
+
className: "ds-pagination__per-page",
|
|
43
|
+
children: [/* @__PURE__ */ i("span", {
|
|
44
|
+
id: _,
|
|
45
|
+
children: "Per page"
|
|
46
|
+
}), /* @__PURE__ */ i("div", {
|
|
47
|
+
className: "ds-pagination__select",
|
|
48
|
+
children: /* @__PURE__ */ i(t, {
|
|
49
|
+
"aria-labelledby": _,
|
|
50
|
+
value: String(s),
|
|
51
|
+
options: l.map((e) => ({
|
|
52
|
+
value: String(e),
|
|
53
|
+
label: String(e)
|
|
54
|
+
})),
|
|
55
|
+
size: u,
|
|
56
|
+
menuPlacement: p,
|
|
57
|
+
isDisabled: b || n <= Math.min(...l),
|
|
58
|
+
onValueChange: (e) => {
|
|
59
|
+
let t = Number(e);
|
|
60
|
+
if (t === s) return;
|
|
61
|
+
let r = Math.floor((y - 1) * s / t) + 1, i = Math.max(1, Math.ceil(n / t));
|
|
62
|
+
c({
|
|
63
|
+
page: Math.min(r, i),
|
|
64
|
+
pageSize: t
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
})
|
|
68
|
+
})]
|
|
69
|
+
}), /* @__PURE__ */ i("span", {
|
|
70
|
+
className: "ds-pagination__range",
|
|
71
|
+
"aria-live": "polite",
|
|
72
|
+
"aria-atomic": "true",
|
|
73
|
+
children: n === 0 ? "No results" : `${C.toLocaleString("en-US")}–${w.toLocaleString("en-US")} of ${n.toLocaleString("en-US")}`
|
|
74
|
+
})]
|
|
75
|
+
}),
|
|
76
|
+
/* @__PURE__ */ i("div", {
|
|
77
|
+
className: "ds-pagination__actions ds-pagination__actions--next",
|
|
78
|
+
children: /* @__PURE__ */ i(e, {
|
|
79
|
+
variant: "neutral",
|
|
80
|
+
size: u,
|
|
81
|
+
iconStart: f ? void 0 : "chevron-right",
|
|
82
|
+
iconEnd: f ? "chevron-right" : void 0,
|
|
83
|
+
isIconOnly: !f,
|
|
84
|
+
"aria-label": "Next page",
|
|
85
|
+
isDisabled: S,
|
|
86
|
+
onClick: () => T(y + 1),
|
|
87
|
+
children: "Next"
|
|
88
|
+
})
|
|
89
|
+
})
|
|
90
|
+
]
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
//#endregion
|
|
94
|
+
export { o as Pagination };
|
|
95
|
+
|
|
96
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["Pagination","forwardRef","rest","labelId","useId","pageCount","totalResults","pageSize","currentPage","page","disabled","isDisabled","atStart","atEnd","start","end","go","next","nextPage","onChange","size","className","Button","showLabels","Select","pageSizeOptions","value","nextSize","nextPageCount"],"sources":["../../../src/components/Pagination/index.tsx"],"sourcesContent":["import { forwardRef, useId, type HTMLAttributes } from \"react\";\nimport { Button } from \"../Button\";\nimport { Select } from \"../Select\";\nimport type { PopoverPlacement } from \"../Popover\";\nimport \"./style.css\";\n\nexport type PaginationSize = \"sm\" | \"md\";\n\nexport interface PaginationState {\n /** One-based page number. */\n page: number;\n /** Positive integer results per page. */\n pageSize: number;\n}\n\nexport interface PaginationProps\n extends\n Omit<HTMLAttributes<HTMLElement>, \"children\" | \"onChange\">,\n PaginationState {\n /** Total number of matching results, before pagination. */\n totalResults: number;\n /** Emitted once per user change, with both values ready to apply together. */\n onChange: (next: PaginationState) => void;\n /** Nonempty list of positive integers containing the current pageSize. */\n pageSizeOptions?: number[];\n size?: PaginationSize;\n isDisabled?: boolean;\n showLabels?: boolean;\n menuPlacement?: PopoverPlacement;\n}\n\n/** Controlled navigation for a result set. Data loading and slicing belong to the application. */\nexport const Pagination = forwardRef<HTMLElement, PaginationProps>(\n function Pagination(\n {\n totalResults,\n page,\n pageSize,\n onChange,\n pageSizeOptions = [10, 25, 50, 100],\n size = \"sm\",\n isDisabled = false,\n showLabels = true,\n menuPlacement = \"bottom\",\n className,\n ...rest\n },\n ref,\n ) {\n const labelId = useId();\n const pageCount = Math.max(1, Math.ceil(totalResults / pageSize));\n const currentPage = Math.min(Math.max(1, page), pageCount);\n const disabled = isDisabled || totalResults === 0;\n const atStart = disabled || currentPage === 1;\n const atEnd = disabled || currentPage === pageCount;\n const start = (currentPage - 1) * pageSize + 1;\n const end = Math.min(currentPage * pageSize, totalResults);\n\n const go = (nextPage: number) => {\n const next = Math.min(Math.max(1, nextPage), pageCount);\n if (next !== currentPage) onChange({ page: next, pageSize });\n };\n\n return (\n <nav\n ref={ref}\n aria-label=\"Pagination\"\n data-size={size}\n className={[\"ds-pagination\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n <div className=\"ds-pagination__actions\">\n <Button\n variant=\"neutral\"\n size={size}\n iconStart=\"chevron-left\"\n isIconOnly={!showLabels}\n aria-label=\"Previous page\"\n isDisabled={atStart}\n onClick={() => go(currentPage - 1)}\n >\n Previous\n </Button>\n </div>\n\n <div className=\"ds-pagination__centre\">\n <div className=\"ds-pagination__per-page\">\n <span id={labelId}>Per page</span>\n <div className=\"ds-pagination__select\">\n <Select\n aria-labelledby={labelId}\n value={String(pageSize)}\n options={pageSizeOptions.map((value) => ({\n value: String(value),\n label: String(value),\n }))}\n size={size}\n menuPlacement={menuPlacement}\n isDisabled={\n disabled || totalResults <= Math.min(...pageSizeOptions)\n }\n onValueChange={(value) => {\n const nextSize = Number(value);\n if (nextSize === pageSize) return;\n const nextPage =\n Math.floor(((currentPage - 1) * pageSize) / nextSize) + 1;\n const nextPageCount = Math.max(\n 1,\n Math.ceil(totalResults / nextSize),\n );\n onChange({\n page: Math.min(nextPage, nextPageCount),\n pageSize: nextSize,\n });\n }}\n />\n </div>\n </div>\n <span\n className=\"ds-pagination__range\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n {totalResults === 0\n ? \"No results\"\n : `${start.toLocaleString(\"en-US\")}–${end.toLocaleString(\"en-US\")} of ${totalResults.toLocaleString(\"en-US\")}`}\n </span>\n </div>\n\n <div className=\"ds-pagination__actions ds-pagination__actions--next\">\n <Button\n variant=\"neutral\"\n size={size}\n iconStart={showLabels ? undefined : \"chevron-right\"}\n iconEnd={showLabels ? \"chevron-right\" : undefined}\n isIconOnly={!showLabels}\n aria-label=\"Next page\"\n isDisabled={atEnd}\n onClick={() => go(currentPage + 1)}\n >\n Next\n </Button>\n </div>\n </nav>\n );\n },\n);\n"],"mappings":";;;;;AAgCA,IAAaA,IAAaC,EACxB,SACE,EACE,iBACA,SACA,aACA,aACA,qBAAkB;CAAC;CAAI;CAAI;CAAI;AAAG,GAClC,UAAO,MACP,gBAAa,IACb,gBAAa,IACb,mBAAgB,UAChB,cACA,GAAGC,KAEL,GACA;CACA,IAAMC,IAAUC,EAAM,GAChBC,IAAY,KAAK,IAAI,GAAG,KAAK,KAAKC,IAAeC,CAAQ,CAAC,GAC1DC,IAAc,KAAK,IAAI,KAAK,IAAI,GAAGC,CAAI,GAAGJ,CAAS,GACnDK,IAAWC,KAAcL,MAAiB,GAC1CM,IAAUF,KAAYF,MAAgB,GACtCK,IAAQH,KAAYF,MAAgBH,GACpCS,KAASN,IAAc,KAAKD,IAAW,GACvCQ,IAAM,KAAK,IAAIP,IAAcD,GAAUD,CAAY,GAEnDU,KAAM,MAAqB;EAC/B,IAAMC,IAAO,KAAK,IAAI,KAAK,IAAI,GAAGC,CAAQ,GAAGb,CAAS;EACtD,AAAIY,MAAST,KAAaW,EAAS;GAAE,MAAMF;GAAM;EAAS,CAAC;CAC7D;CAEA,OACE,kBAAC,OAAD;EACO;EACL,cAAW;EACX,aAAWG;EACX,WAAW,CAAC,iBAAiBC,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAChE,GAAInB;EALN,UAAA;GAOE,kBAAC,OAAD;IAAK,WAAU;IACb,UAAA,kBAACoB,GAAD;KACE,SAAQ;KACF;KACN,WAAU;KACV,YAAY,CAACC;KACb,cAAW;KACX,YAAYX;KACZ,eAAeI,EAAGR,IAAc,CAAC;KAClC,UAAA;IAEO,CAAA;GACL,CAAA;GAEL,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACE,kBAAC,OAAD;KAAK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|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: space-between;
|
|
7
|
+
gap: var(--space-4);
|
|
8
|
+
padding: var(--space-3) var(--space-5);
|
|
9
|
+
font-family: var(--font-sans);
|
|
10
|
+
color: var(--color-text);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.ds-pagination__actions {
|
|
14
|
+
flex: none;
|
|
15
|
+
align-self: center;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.ds-pagination__actions--next {
|
|
19
|
+
margin-inline-start: auto;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.ds-pagination__centre {
|
|
23
|
+
display: flex;
|
|
24
|
+
flex: 1 1 15rem;
|
|
25
|
+
flex-wrap: wrap;
|
|
26
|
+
align-items: center;
|
|
27
|
+
justify-content: center;
|
|
28
|
+
min-inline-size: 0;
|
|
29
|
+
gap: var(--space-2) var(--space-6);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.ds-pagination__per-page {
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
gap: var(--space-2);
|
|
36
|
+
color: var(--color-text-muted);
|
|
37
|
+
font-size: var(--font-size-sm);
|
|
38
|
+
white-space: nowrap;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.ds-pagination__select {
|
|
42
|
+
inline-size: 5rem;
|
|
43
|
+
flex: none;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.ds-pagination__range {
|
|
47
|
+
color: var(--color-text-muted);
|
|
48
|
+
font-size: var(--font-size-sm);
|
|
49
|
+
font-variant-numeric: tabular-nums;
|
|
50
|
+
white-space: nowrap;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("react"),t=require("react
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("react"),t=require("react-dom"),n=require("react/jsx-runtime");function r(...e){return e.filter(Boolean).join(` `)}var i=8;function a({anchorRef:a,anchorId:o,isOpen:s,align:c=`start`,placement:l=`bottom`,matchAnchorWidth:u=!1,offset:d=4,className:f,children:p,role:m,id:h,panelRef:g,..._}){let v=(0,e.useRef)(null),y=(0,e.useId)(),b=h??y,x=(0,e.useCallback)(()=>{let e=a.current??(o?document.getElementById(o):null),t=v.current;if(!e||!t)return;let n=e.getBoundingClientRect();u&&(t.style.width=`${n.width}px`);let r=t.getBoundingClientRect(),s=document.documentElement.clientWidth,f=document.documentElement.clientHeight,p=f-n.bottom-d-i,m=n.top-d-i,h=l===`top`?m>=r.height||m>p:p<r.height&&m>p,g=Math.max(120,h?m:p),_=h?Math.max(i,n.top-d-Math.min(r.height,g)):Math.min(n.bottom+d,f-i),y=c===`end`?n.right-r.width:n.left,b=Math.max(i,Math.min(y,s-r.width-i));t.style.left=`${Math.round(b)}px`,t.style.top=`${Math.round(_)}px`,t.style.setProperty(`--popover-max-block-size`,`${Math.round(g)}px`),t.style.visibility=`visible`},[c,o,a,u,d,l]);if((0,e.useEffect)(()=>{if(!s)return;let e=document.querySelector(`[data-popover-instance="${CSS.escape(y)}"]`);v.current=e,g&&(g.current=e),x();let t=()=>x();return window.addEventListener(`resize`,t),window.addEventListener(`scroll`,t,!0),()=>{window.removeEventListener(`resize`,t),window.removeEventListener(`scroll`,t,!0),v.current=null,g&&(g.current=null)}},[y,s,b,g,x]),!s||typeof document>`u`)return null;let S=(0,n.jsx)(`div`,{id:b,"data-popover-instance":y,role:m,className:r(`ds-popover`,f),..._,children:p});return(0,t.createPortal)(S,document.body)}exports.Popover=a;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["useRef","useId","useCallback","createPortal","react","
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["useRef","useId","useCallback","createPortal","react","react_dom","react_jsx_runtime","cx","parts","VIEWPORT_MARGIN","Popover","rest","floatingRef","generatedId","panelId","id","place","reference","anchorRef","anchorId","floating","anchor","matchAnchorWidth","panel","viewportWidth","viewportHeight","roomBelow","offset","roomAbove","placeAbove","placement","availableHeight","top","preferredLeft","align","left","isOpen","panelRef","update","className"],"sources":["../../../src/components/Popover/index.tsx"],"sourcesContent":["import { useCallback, useEffect, useId, useRef, type ReactNode, type RefObject } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport \"./style.css\";\n\nfunction cx(...parts: (string | undefined | false)[]) {\n return parts.filter(Boolean).join(\" \");\n}\n\nconst VIEWPORT_MARGIN = 8;\n\nexport type PopoverAlign = \"start\" | \"end\";\nexport type PopoverPlacement = \"top\" | \"bottom\";\n\nexport interface PopoverProps {\n /** The control the panel hangs off. */\n anchorRef: RefObject<HTMLElement | null>;\n /** Optional DOM id fallback for composed controls whose refs are consumed by a field wrapper. */\n anchorId?: string;\n isOpen: boolean;\n /** Which edge of the anchor the panel lines up with. Flips when it must. */\n align?: PopoverAlign;\n /** Preferred side of the anchor. Flips when the other side has more room. */\n placement?: PopoverPlacement;\n /** Match the anchor's width — for listboxes that read as one field. */\n matchAnchorWidth?: boolean;\n /** Gap between anchor and panel. */\n offset?: number;\n className?: string;\n children: ReactNode;\n role?: string;\n id?: string;\n \"aria-label\"?: string;\n \"aria-labelledby\"?: string;\n panelRef?: RefObject<HTMLDivElement | null>;\n}\n\n/**\n * A panel anchored to a control. It is positioned against the viewport, so it\n * flips above the anchor when the space below runs out and slides inward\n * rather than being cut off at any edge.\n */\nexport function Popover({\n anchorRef,\n anchorId,\n isOpen,\n align = \"start\",\n placement = \"bottom\",\n matchAnchorWidth = false,\n offset = 4,\n className,\n children,\n role,\n id,\n panelRef,\n ...rest\n}: PopoverProps) {\n const floatingRef = useRef<HTMLDivElement | null>(null);\n const generatedId = useId();\n const panelId = id ?? generatedId;\n\n const place = useCallback(() => {\n const reference = anchorRef.current ?? (anchorId ? document.getElementById(anchorId) : null);\n const floating = floatingRef.current;\n if (!reference || !floating) return;\n\n const anchor = reference.getBoundingClientRect();\n if (matchAnchorWidth) floating.style.width = `${anchor.width}px`;\n const panel = floating.getBoundingClientRect();\n const viewportWidth = document.documentElement.clientWidth;\n const viewportHeight = document.documentElement.clientHeight;\n const roomBelow = viewportHeight - anchor.bottom - offset - VIEWPORT_MARGIN;\n const roomAbove = anchor.top - offset - VIEWPORT_MARGIN;\n const placeAbove = placement === \"top\"\n ? roomAbove >= panel.height || roomAbove > roomBelow\n : roomBelow < panel.height && roomAbove > roomBelow;\n const availableHeight = Math.max(120, placeAbove ? roomAbove : roomBelow);\n const top = placeAbove\n ? Math.max(VIEWPORT_MARGIN, anchor.top - offset - Math.min(panel.height, availableHeight))\n : Math.min(anchor.bottom + offset, viewportHeight - VIEWPORT_MARGIN);\n const preferredLeft = align === \"end\" ? anchor.right - panel.width : anchor.left;\n const left = Math.max(\n VIEWPORT_MARGIN,\n Math.min(preferredLeft, viewportWidth - panel.width - VIEWPORT_MARGIN),\n );\n\n floating.style.left = `${Math.round(left)}px`;\n floating.style.top = `${Math.round(top)}px`;\n floating.style.setProperty(\"--popover-max-block-size\", `${Math.round(availableHeight)}px`);\n floating.style.visibility = \"visible\";\n }, [align, anchorId, anchorRef, matchAnchorWidth, offset, placement]);\n\n useEffect(() => {\n if (!isOpen) return;\n const floating = document.querySelector<HTMLDivElement>(\n `[data-popover-instance=\"${CSS.escape(generatedId)}\"]`,\n );\n floatingRef.current = floating;\n if (panelRef) panelRef.current = floating;\n place();\n const update = () => place();\n window.addEventListener(\"resize\", update);\n window.addEventListener(\"scroll\", update, true);\n return () => {\n window.removeEventListener(\"resize\", update);\n window.removeEventListener(\"scroll\", update, true);\n floatingRef.current = null;\n if (panelRef) panelRef.current = null;\n };\n }, [generatedId, isOpen, panelId, panelRef, place]);\n\n if (!isOpen || typeof document === \"undefined\") return null;\n\n const panel = (\n <div\n id={panelId}\n data-popover-instance={generatedId}\n role={role}\n className={cx(\"ds-popover\", className)}\n {...rest}\n >\n {children}\n </div>\n );\n\n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K,IAAIwB,EAAeT,EAAgBD,EAAM,MAAQd,CAAe,CACvE,EAEA,EAAS,MAAM,KAAO,GAAG,KAAK,MAAM0B,CAAI,EAAE,IAC1C,EAAS,MAAM,IAAM,GAAG,KAAK,MAAMH,CAAG,EAAE,IACxCZ,EAAS,MAAM,YAAY,2BAA4B,GAAG,KAAK,MAAMW,CAAe,EAAE,GAAG,EACzF,EAAS,MAAM,WAAa,SAC9B,EAAG,CAACG,EAAOf,EAAUD,EAAWI,EAAkBK,EAAQG,CAAS,CAAC,EAqBpE,IAnBA,EAAA1B,EAAA,UAAA,KAAgB,CACd,GAAI,CAACgC,EAAQ,OACb,IAAMhB,EAAW,SAAS,cACxB,2BAA2B,IAAI,OAAOP,CAAW,EAAE,GACrD,EACA,EAAY,QAAUO,EAClBiB,IAAU,EAAS,QAAUjB,GACjCJ,EAAM,EACN,IAAMsB,MAAetB,EAAM,EAG3B,OAFA,OAAO,iBAAiB,SAAUsB,CAAM,EACxC,OAAO,iBAAiB,SAAUA,EAAQ,EAAI,MACjC,CACX,OAAO,oBAAoB,SAAUA,CAAM,EAC3C,OAAO,oBAAoB,SAAUA,EAAQ,EAAI,EACjD,EAAY,QAAU,KAClBD,IAAU,EAAS,QAAU,KACnC,CACF,EAAG,CAACxB,EAAauB,EAAQtB,EAASuB,EAAUrB,CAAK,CAAC,EAE9C,CAACoB,GAAU,OAAO,SAAa,IAAa,OAAO,KAEvD,IAAMb,GACJ,EAAAjB,EAAA,IAAA,CAAC,MAAD,CACE,GAAIQ,EACJ,wBAAuBD,EACjB,OACN,UAAWN,EAAG,aAAcgC,CAAS,EACrC,GAAI5B,EAEH,UACE,CAAA,EAGP,OAAA,EAAOR,EAAAA,aAAAA,CAAaoB,EAAO,SAAS,IAAI,CAC1C,C"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type ReactNode, type RefObject } from "react";
|
|
2
2
|
export type PopoverAlign = "start" | "end";
|
|
3
|
+
export type PopoverPlacement = "top" | "bottom";
|
|
3
4
|
export interface PopoverProps {
|
|
4
5
|
/** The control the panel hangs off. */
|
|
5
6
|
anchorRef: RefObject<HTMLElement | null>;
|
|
@@ -8,6 +9,8 @@ export interface PopoverProps {
|
|
|
8
9
|
isOpen: boolean;
|
|
9
10
|
/** Which edge of the anchor the panel lines up with. Flips when it must. */
|
|
10
11
|
align?: PopoverAlign;
|
|
12
|
+
/** Preferred side of the anchor. Flips when the other side has more room. */
|
|
13
|
+
placement?: PopoverPlacement;
|
|
11
14
|
/** Match the anchor's width — for listboxes that read as one field. */
|
|
12
15
|
matchAnchorWidth?: boolean;
|
|
13
16
|
/** Gap between anchor and panel. */
|
|
@@ -17,6 +20,7 @@ export interface PopoverProps {
|
|
|
17
20
|
role?: string;
|
|
18
21
|
id?: string;
|
|
19
22
|
"aria-label"?: string;
|
|
23
|
+
"aria-labelledby"?: string;
|
|
20
24
|
panelRef?: RefObject<HTMLDivElement | null>;
|
|
21
25
|
}
|
|
22
26
|
/**
|
|
@@ -24,5 +28,5 @@ export interface PopoverProps {
|
|
|
24
28
|
* flips above the anchor when the space below runs out and slides inward
|
|
25
29
|
* rather than being cut off at any edge.
|
|
26
30
|
*/
|
|
27
|
-
export declare function Popover({ anchorRef, anchorId, isOpen, align, matchAnchorWidth, offset, className, children, role, id, panelRef, ...rest }: PopoverProps): import("react").ReactPortal | null;
|
|
31
|
+
export declare function Popover({ anchorRef, anchorId, isOpen, align, placement, matchAnchorWidth, offset, className, children, role, id, panelRef, ...rest }: PopoverProps): import("react").ReactPortal | null;
|
|
28
32
|
//# sourceMappingURL=index.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Popover/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAyC,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9F,OAAO,aAAa,CAAC;AAQrB,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,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 +1,6 @@
|
|
|
1
1
|
import { type ReactNode, type RefObject } from "react";
|
|
2
2
|
export type PopoverAlign = "start" | "end";
|
|
3
|
+
export type PopoverPlacement = "top" | "bottom";
|
|
3
4
|
export interface PopoverProps {
|
|
4
5
|
/** The control the panel hangs off. */
|
|
5
6
|
anchorRef: RefObject<HTMLElement | null>;
|
|
@@ -8,6 +9,8 @@ export interface PopoverProps {
|
|
|
8
9
|
isOpen: boolean;
|
|
9
10
|
/** Which edge of the anchor the panel lines up with. Flips when it must. */
|
|
10
11
|
align?: PopoverAlign;
|
|
12
|
+
/** Preferred side of the anchor. Flips when the other side has more room. */
|
|
13
|
+
placement?: PopoverPlacement;
|
|
11
14
|
/** Match the anchor's width — for listboxes that read as one field. */
|
|
12
15
|
matchAnchorWidth?: boolean;
|
|
13
16
|
/** Gap between anchor and panel. */
|
|
@@ -17,6 +20,7 @@ export interface PopoverProps {
|
|
|
17
20
|
role?: string;
|
|
18
21
|
id?: string;
|
|
19
22
|
"aria-label"?: string;
|
|
23
|
+
"aria-labelledby"?: string;
|
|
20
24
|
panelRef?: RefObject<HTMLDivElement | null>;
|
|
21
25
|
}
|
|
22
26
|
/**
|
|
@@ -24,5 +28,5 @@ export interface PopoverProps {
|
|
|
24
28
|
* flips above the anchor when the space below runs out and slides inward
|
|
25
29
|
* rather than being cut off at any edge.
|
|
26
30
|
*/
|
|
27
|
-
export declare function Popover({ anchorRef, anchorId, isOpen, align, matchAnchorWidth, offset, className, children, role, id, panelRef, ...rest }: PopoverProps): import("react").ReactPortal | null;
|
|
31
|
+
export declare function Popover({ anchorRef, anchorId, isOpen, align, placement, matchAnchorWidth, offset, className, children, role, id, panelRef, ...rest }: PopoverProps): import("react").ReactPortal | null;
|
|
28
32
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Popover/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAyC,KAA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AU,EACV,SAAS,EACT,QAAQ,EACR,IAAI,EACJ,EAAE,EACF,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,YAAY,sCAsEd"}
|
|
@@ -1,50 +1,51 @@
|
|
|
1
1
|
import { useCallback as e, useEffect as t, useId as n, useRef as r } from "react";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { createPortal as i } from "react-dom";
|
|
3
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/Popover/index.tsx
|
|
5
5
|
function o(...e) {
|
|
6
6
|
return e.filter(Boolean).join(" ");
|
|
7
7
|
}
|
|
8
8
|
var s = 8;
|
|
9
|
-
function c({ anchorRef: c, anchorId: l, isOpen: u, align: d = "start",
|
|
10
|
-
let
|
|
11
|
-
let e = c.current ?? (l ? document.getElementById(l) : null), t =
|
|
9
|
+
function c({ anchorRef: c, anchorId: l, isOpen: u, align: d = "start", placement: f = "bottom", matchAnchorWidth: p = !1, offset: m = 4, className: h, children: g, role: _, id: v, panelRef: y, ...b }) {
|
|
10
|
+
let x = r(null), S = n(), C = v ?? S, w = e(() => {
|
|
11
|
+
let e = c.current ?? (l ? document.getElementById(l) : null), t = x.current;
|
|
12
12
|
if (!e || !t) return;
|
|
13
13
|
let n = e.getBoundingClientRect();
|
|
14
|
-
|
|
15
|
-
let r = t.getBoundingClientRect(), i = document.documentElement.clientWidth, a = document.documentElement.clientHeight, o = a - n.bottom -
|
|
16
|
-
t.style.left = `${Math.round(
|
|
14
|
+
p && (t.style.width = `${n.width}px`);
|
|
15
|
+
let r = t.getBoundingClientRect(), i = document.documentElement.clientWidth, a = document.documentElement.clientHeight, o = a - n.bottom - m - s, u = n.top - m - s, h = f === "top" ? u >= r.height || u > o : o < r.height && u > o, g = Math.max(120, h ? u : o), _ = h ? Math.max(s, n.top - m - Math.min(r.height, g)) : Math.min(n.bottom + m, a - s), v = d === "end" ? n.right - r.width : n.left, y = Math.max(s, Math.min(v, i - r.width - s));
|
|
16
|
+
t.style.left = `${Math.round(y)}px`, t.style.top = `${Math.round(_)}px`, t.style.setProperty("--popover-max-block-size", `${Math.round(g)}px`), t.style.visibility = "visible";
|
|
17
17
|
}, [
|
|
18
18
|
d,
|
|
19
19
|
l,
|
|
20
20
|
c,
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
p,
|
|
22
|
+
m,
|
|
23
|
+
f
|
|
23
24
|
]);
|
|
24
25
|
if (t(() => {
|
|
25
26
|
if (!u) return;
|
|
26
|
-
let e = document.querySelector(`[data-popover-instance="${CSS.escape(
|
|
27
|
-
|
|
28
|
-
let t = () =>
|
|
27
|
+
let e = document.querySelector(`[data-popover-instance="${CSS.escape(S)}"]`);
|
|
28
|
+
x.current = e, y && (y.current = e), w();
|
|
29
|
+
let t = () => w();
|
|
29
30
|
return window.addEventListener("resize", t), window.addEventListener("scroll", t, !0), () => {
|
|
30
|
-
window.removeEventListener("resize", t), window.removeEventListener("scroll", t, !0),
|
|
31
|
+
window.removeEventListener("resize", t), window.removeEventListener("scroll", t, !0), x.current = null, y && (y.current = null);
|
|
31
32
|
};
|
|
32
33
|
}, [
|
|
33
|
-
x,
|
|
34
|
-
u,
|
|
35
34
|
S,
|
|
36
|
-
|
|
37
|
-
C
|
|
35
|
+
u,
|
|
36
|
+
C,
|
|
37
|
+
y,
|
|
38
|
+
w
|
|
38
39
|
]), !u || typeof document > "u") return null;
|
|
39
|
-
let
|
|
40
|
-
id:
|
|
41
|
-
"data-popover-instance":
|
|
42
|
-
role:
|
|
43
|
-
className: o("ds-popover",
|
|
44
|
-
...
|
|
45
|
-
children:
|
|
40
|
+
let T = /* @__PURE__ */ a("div", {
|
|
41
|
+
id: C,
|
|
42
|
+
"data-popover-instance": S,
|
|
43
|
+
role: _,
|
|
44
|
+
className: o("ds-popover", h),
|
|
45
|
+
...b,
|
|
46
|
+
children: g
|
|
46
47
|
});
|
|
47
|
-
return
|
|
48
|
+
return i(T, document.body);
|
|
48
49
|
}
|
|
49
50
|
//#endregion
|
|
50
51
|
export { c as Popover };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["cx","parts","VIEWPORT_MARGIN","Popover","rest","floatingRef","useRef","generatedId","useId","panelId","id","place","useCallback","reference","anchorRef","anchorId","floating","anchor","matchAnchorWidth","panel","viewportWidth","viewportHeight","roomBelow","offset","roomAbove","placeAbove","availableHeight","top","preferredLeft","align","left","useEffect","isOpen","panelRef","update","className","createPortal"],"sources":["../../../src/components/Popover/index.tsx"],"sourcesContent":["import { useCallback, useEffect, useId, useRef, type ReactNode, type RefObject } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport \"./style.css\";\n\nfunction cx(...parts: (string | undefined | false)[]) {\n return parts.filter(Boolean).join(\" \");\n}\n\nconst VIEWPORT_MARGIN = 8;\n\nexport type PopoverAlign = \"start\" | \"end\";\n\nexport interface PopoverProps {\n /** The control the panel hangs off. */\n anchorRef: RefObject<HTMLElement | null>;\n /** Optional DOM id fallback for composed controls whose refs are consumed by a field wrapper. */\n anchorId?: string;\n isOpen: boolean;\n /** Which edge of the anchor the panel lines up with. Flips when it must. */\n align?: PopoverAlign;\n /** Match the anchor's width — for listboxes that read as one field. */\n matchAnchorWidth?: boolean;\n /** Gap between anchor and panel. */\n offset?: number;\n className?: string;\n children: ReactNode;\n role?: string;\n id?: string;\n \"aria-label\"?: string;\n panelRef?: RefObject<HTMLDivElement | null>;\n}\n\n/**\n * A panel anchored to a control. It is positioned against the viewport, so it\n * flips above the anchor when the space below runs out and slides inward\n * rather than being cut off at any edge.\n */\nexport function Popover({\n anchorRef,\n anchorId,\n isOpen,\n align = \"start\",\n matchAnchorWidth = false,\n offset = 4,\n className,\n children,\n role,\n id,\n panelRef,\n ...rest\n}: PopoverProps) {\n const floatingRef = useRef<HTMLDivElement | null>(null);\n const generatedId = useId();\n const panelId = id ?? generatedId;\n\n const place = useCallback(() => {\n const reference = anchorRef.current ?? (anchorId ? document.getElementById(anchorId) : null);\n const floating = floatingRef.current;\n if (!reference || !floating) return;\n\n const anchor = reference.getBoundingClientRect();\n if (matchAnchorWidth) floating.style.width = `${anchor.width}px`;\n const panel = floating.getBoundingClientRect();\n const viewportWidth = document.documentElement.clientWidth;\n const viewportHeight = document.documentElement.clientHeight;\n const roomBelow = viewportHeight - anchor.bottom - offset - VIEWPORT_MARGIN;\n const roomAbove = anchor.top - offset - VIEWPORT_MARGIN;\n const placeAbove = roomBelow < panel.height && roomAbove > roomBelow;\n const availableHeight = Math.max(120, placeAbove ? roomAbove : roomBelow);\n const top = placeAbove\n ? Math.max(VIEWPORT_MARGIN, anchor.top - offset - Math.min(panel.height, availableHeight))\n : Math.min(anchor.bottom + offset, viewportHeight - VIEWPORT_MARGIN);\n const preferredLeft = align === \"end\" ? anchor.right - panel.width : anchor.left;\n const left = Math.max(\n VIEWPORT_MARGIN,\n Math.min(preferredLeft, viewportWidth - panel.width - VIEWPORT_MARGIN),\n );\n\n floating.style.left = `${Math.round(left)}px`;\n floating.style.top = `${Math.round(top)}px`;\n floating.style.setProperty(\"--popover-max-block-size\", `${Math.round(availableHeight)}px`);\n floating.style.visibility = \"visible\";\n }, [align, anchorId, anchorRef, matchAnchorWidth, offset]);\n\n useEffect(() => {\n if (!isOpen) return;\n const floating = document.querySelector<HTMLDivElement>(\n `[data-popover-instance=\"${CSS.escape(generatedId)}\"]`,\n );\n floatingRef.current = floating;\n if (panelRef) panelRef.current = floating;\n place();\n const update = () => place();\n window.addEventListener(\"resize\", update);\n window.addEventListener(\"scroll\", update, true);\n return () => {\n window.removeEventListener(\"resize\", update);\n window.removeEventListener(\"scroll\", update, true);\n floatingRef.current = null;\n if (panelRef) panelRef.current = null;\n };\n }, [generatedId, isOpen, panelId, panelRef, place]);\n\n if (!isOpen || typeof document === \"undefined\") return null;\n\n const panel = (\n <div\n id={panelId}\n data-popover-instance={generatedId}\n role={role}\n className={cx(\"ds-popover\", className)}\n {...rest}\n >\n {children}\n </div>\n );\n\n return createPortal(panel, document.body);\n}\n"],"mappings":";;;;AAIA,SAASA,EAAG,GAAGC,GAAuC;CACpD,OAAOA,EAAM,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;AACvC;AAEA,IAAMC,IAAkB;
|
|
1
|
+
{"version":3,"file":"index.js","names":["cx","parts","VIEWPORT_MARGIN","Popover","rest","floatingRef","useRef","generatedId","useId","panelId","id","place","useCallback","reference","anchorRef","anchorId","floating","anchor","matchAnchorWidth","panel","viewportWidth","viewportHeight","roomBelow","offset","roomAbove","placeAbove","placement","availableHeight","top","preferredLeft","align","left","useEffect","isOpen","panelRef","update","className","createPortal"],"sources":["../../../src/components/Popover/index.tsx"],"sourcesContent":["import { useCallback, useEffect, useId, useRef, type ReactNode, type RefObject } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport \"./style.css\";\n\nfunction cx(...parts: (string | undefined | false)[]) {\n return parts.filter(Boolean).join(\" \");\n}\n\nconst VIEWPORT_MARGIN = 8;\n\nexport type PopoverAlign = \"start\" | \"end\";\nexport type PopoverPlacement = \"top\" | \"bottom\";\n\nexport interface PopoverProps {\n /** The control the panel hangs off. */\n anchorRef: RefObject<HTMLElement | null>;\n /** Optional DOM id fallback for composed controls whose refs are consumed by a field wrapper. */\n anchorId?: string;\n isOpen: boolean;\n /** Which edge of the anchor the panel lines up with. Flips when it must. */\n align?: PopoverAlign;\n /** Preferred side of the anchor. Flips when the other side has more room. */\n placement?: PopoverPlacement;\n /** Match the anchor's width — for listboxes that read as one field. */\n matchAnchorWidth?: boolean;\n /** Gap between anchor and panel. */\n offset?: number;\n className?: string;\n children: ReactNode;\n role?: string;\n id?: string;\n \"aria-label\"?: string;\n \"aria-labelledby\"?: string;\n panelRef?: RefObject<HTMLDivElement | null>;\n}\n\n/**\n * A panel anchored to a control. It is positioned against the viewport, so it\n * flips above the anchor when the space below runs out and slides inward\n * rather than being cut off at any edge.\n */\nexport function Popover({\n anchorRef,\n anchorId,\n isOpen,\n align = \"start\",\n placement = \"bottom\",\n matchAnchorWidth = false,\n offset = 4,\n className,\n children,\n role,\n id,\n panelRef,\n ...rest\n}: PopoverProps) {\n const floatingRef = useRef<HTMLDivElement | null>(null);\n const generatedId = useId();\n const panelId = id ?? generatedId;\n\n const place = useCallback(() => {\n const reference = anchorRef.current ?? (anchorId ? document.getElementById(anchorId) : null);\n const floating = floatingRef.current;\n if (!reference || !floating) return;\n\n const anchor = reference.getBoundingClientRect();\n if (matchAnchorWidth) floating.style.width = `${anchor.width}px`;\n const panel = floating.getBoundingClientRect();\n const viewportWidth = document.documentElement.clientWidth;\n const viewportHeight = document.documentElement.clientHeight;\n const roomBelow = viewportHeight - anchor.bottom - offset - VIEWPORT_MARGIN;\n const roomAbove = anchor.top - offset - VIEWPORT_MARGIN;\n const placeAbove = placement === \"top\"\n ? roomAbove >= panel.height || roomAbove > roomBelow\n : roomBelow < panel.height && roomAbove > roomBelow;\n const availableHeight = Math.max(120, placeAbove ? roomAbove : roomBelow);\n const top = placeAbove\n ? Math.max(VIEWPORT_MARGIN, anchor.top - offset - Math.min(panel.height, availableHeight))\n : Math.min(anchor.bottom + offset, viewportHeight - VIEWPORT_MARGIN);\n const preferredLeft = align === \"end\" ? anchor.right - panel.width : anchor.left;\n const left = Math.max(\n VIEWPORT_MARGIN,\n Math.min(preferredLeft, viewportWidth - panel.width - VIEWPORT_MARGIN),\n );\n\n floating.style.left = `${Math.round(left)}px`;\n floating.style.top = `${Math.round(top)}px`;\n floating.style.setProperty(\"--popover-max-block-size\", `${Math.round(availableHeight)}px`);\n floating.style.visibility = \"visible\";\n }, [align, anchorId, anchorRef, matchAnchorWidth, offset, placement]);\n\n useEffect(() => {\n if (!isOpen) return;\n const floating = document.querySelector<HTMLDivElement>(\n `[data-popover-instance=\"${CSS.escape(generatedId)}\"]`,\n );\n floatingRef.current = floating;\n if (panelRef) panelRef.current = floating;\n place();\n const update = () => place();\n window.addEventListener(\"resize\", update);\n window.addEventListener(\"scroll\", update, true);\n return () => {\n window.removeEventListener(\"resize\", update);\n window.removeEventListener(\"scroll\", update, true);\n floatingRef.current = null;\n if (panelRef) panelRef.current = null;\n };\n }, [generatedId, isOpen, panelId, panelRef, place]);\n\n if (!isOpen || typeof document === \"undefined\") return null;\n\n const panel = (\n <div\n id={panelId}\n data-popover-instance={generatedId}\n role={role}\n className={cx(\"ds-popover\", className)}\n {...rest}\n >\n {children}\n </div>\n );\n\n return createPortal(panel, document.body);\n}\n"],"mappings":";;;;AAIA,SAASA,EAAG,GAAGC,GAAuC;CACpD,OAAOA,EAAM,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;AACvC;AAEA,IAAMC,IAAkB;AAiCxB,SAAgBC,EAAQ,EACtB,cACA,aACA,WACA,WAAQ,SACR,eAAY,UACZ,sBAAmB,IACnB,YAAS,GACT,cACA,aACA,SACA,OACA,aACA,GAAGC,KACY;CACf,IAAMC,IAAcC,EAA8B,IAAI,GAChDC,IAAcC,EAAM,GACpBC,IAAUC,KAAMH,GAEhBI,IAAQC,QAAkB;EAC9B,IAAMC,IAAYC,EAAU,YAAYC,IAAW,SAAS,eAAeA,CAAQ,IAAI,OACjFC,IAAWX,EAAY;EAC7B,IAAI,CAACQ,KAAa,CAACG,GAAU;EAE7B,IAAMC,IAASJ,EAAU,sBAAsB;EAC/C,AAAIK,MAAkB,EAAS,MAAM,QAAQ,GAAGD,EAAO,MAAM;EAC7D,IAAME,IAAQH,EAAS,sBAAsB,GACvCI,IAAgB,SAAS,gBAAgB,aACzCC,IAAiB,SAAS,gBAAgB,cAC1CC,IAAYD,IAAiBJ,EAAO,SAASM,IAASrB,GACtDsB,IAAYP,EAAO,MAAMM,IAASrB,GAClCuB,IAAaC,MAAc,QAC7BF,KAAaL,EAAM,UAAUK,IAAYF,IACzCA,IAAYH,EAAM,UAAUK,IAAYF,GACtCK,IAAkB,KAAK,IAAI,KAAKF,IAAaD,IAAYF,CAAS,GAClEM,IAAMH,IACR,KAAK,IAAIvB,GAAiBe,EAAO,MAAMM,IAAS,KAAK,IAAIJ,EAAM,QAAQQ,CAAe,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 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Icon-CWsA1W83.cjs");;/* empty css */const
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Icon-CWsA1W83.cjs"),t=require("../Button/index.cjs");;/* empty css */const n=require("../FieldAffix/index.cjs");let r=require("react"),i=require("react/jsx-runtime");var a=(0,r.forwardRef)(function({size:a=`md`,isDisabled:o=!1,onClear:s,className:c,placeholder:l=`Search`,value:u,disabled:d,onKeyDown:f,...p},m){let h=(0,r.useRef)(null),g=u!==void 0&&String(u).length>0;return(0,i.jsx)(n.FieldAffix,{className:c,lead:(0,i.jsx)(e.t,{name:`search`,size:16}),isTrailInteractive:!0,trail:g&&s?(0,i.jsx)(t.Button,{variant:`simple`,size:`xs`,isIconOnly:!0,iconStart:`x`,"aria-label":`Clear search`,isDisabled:o||d,onClick:()=>{s(),h.current?.focus()}}):void 0,children:(0,i.jsx)(`input`,{ref:e=>{h.current=e,typeof m==`function`?m(e):m&&(m.current=e)},type:`search`,value:u,placeholder:l,disabled:o||d,"data-size":a,className:`ds-field-skin ds-search__input`,onKeyDown:e=>{e.key===`Escape`&&s&&s(),f?.(e)},...p})})});exports.SearchField=a;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["forwardRef","useRef","FieldAffix","Icon","require_Icon","require_components_FieldAffix_index","react","react_jsx_runtime","SearchField","rest","inner","hasValue","value","onClear","isDisabled","disabled","node","ref","size","event","onKeyDown"],"sources":["../../../src/components/SearchField/index.tsx"],"sourcesContent":["import { forwardRef, useRef, type InputHTMLAttributes } from \"react\";\nimport { Icon } from \"../Icon\";\nimport { FieldAffix } from \"../FieldAffix\";\nimport type { FieldSize } from \"../Field\";\nimport \"../Field/style.css\";\nimport \"./style.css\";\n\nexport interface SearchFieldProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, \"size\" | \"type\"> {\n size?: FieldSize;\n isDisabled?: boolean;\n /** Fired by the clear button and by Escape. */\n onClear?: () => void;\n}\n\n/** A filter over a collection. Carries the glyph, and clears without a Save. */\nexport const SearchField = forwardRef<HTMLInputElement, SearchFieldProps>(function SearchField(\n {\n size = \"md\",\n isDisabled = false,\n onClear,\n className,\n placeholder = \"Search\",\n value,\n disabled,\n onKeyDown,\n ...rest\n },\n ref,\n) {\n const inner = useRef<HTMLInputElement | null>(null);\n const hasValue = value !== undefined ? String(value).length > 0 : false;\n\n return (\n <FieldAffix\n className={className}\n lead={<Icon name=\"search\" size={16} />}\n isTrailInteractive\n trail={\n hasValue && onClear ? (\n <
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["forwardRef","useRef","FieldAffix","Icon","Button","require_Icon","require_components_Button_index","require_components_FieldAffix_index","react","react_jsx_runtime","SearchField","rest","inner","hasValue","value","onClear","isDisabled","disabled","node","ref","size","event","onKeyDown"],"sources":["../../../src/components/SearchField/index.tsx"],"sourcesContent":["import { forwardRef, useRef, type InputHTMLAttributes } from \"react\";\nimport { Icon } from \"../Icon\";\nimport { Button } from \"../Button\";\nimport { FieldAffix } from \"../FieldAffix\";\nimport type { FieldSize } from \"../Field\";\nimport \"../Field/style.css\";\nimport \"./style.css\";\n\nexport interface SearchFieldProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, \"size\" | \"type\"> {\n size?: FieldSize;\n isDisabled?: boolean;\n /** Fired by the clear button and by Escape. */\n onClear?: () => void;\n}\n\n/** A filter over a collection. Carries the glyph, and clears without a Save. */\nexport const SearchField = forwardRef<HTMLInputElement, SearchFieldProps>(function SearchField(\n {\n size = \"md\",\n isDisabled = false,\n onClear,\n className,\n placeholder = \"Search\",\n value,\n disabled,\n onKeyDown,\n ...rest\n },\n ref,\n) {\n const inner = useRef<HTMLInputElement | null>(null);\n const hasValue = value !== undefined ? String(value).length > 0 : false;\n\n return (\n <FieldAffix\n className={className}\n lead={<Icon name=\"search\" size={16} />}\n isTrailInteractive\n trail={\n hasValue && onClear ? (\n <Button\n variant=\"simple\"\n size=\"xs\"\n isIconOnly\n iconStart=\"x\"\n aria-label=\"Clear search\"\n isDisabled={isDisabled || disabled}\n onClick={() => {\n onClear();\n inner.current?.focus();\n }}\n />\n ) : undefined\n }\n >\n <input\n ref={(node) => {\n inner.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) ref.current = node;\n }}\n type=\"search\"\n value={value}\n placeholder={placeholder}\n disabled={isDisabled || disabled}\n data-size={size}\n className=\"ds-field-skin ds-search__input\"\n onKeyDown={(event) => {\n if (event.key === \"Escape\" && onClear) onClear();\n onKeyDown?.(event);\n }}\n {...rest}\n />\n </FieldAffix>\n );\n});\n"],"mappings":"A,kSAiBA,IAAaU,GAAA,EAAcV,EAAAA,WAAAA,CAA+C,SACxE,CACE,OAAO,KACP,aAAa,GACb,UACA,YACA,cAAc,SACd,QACA,WACA,YACA,GAAGW,GAEL,EACA,CACA,IAAMC,GAAA,EAAQX,EAAAA,OAAAA,CAAgC,IAAI,EAC5CY,EAAWC,IAAU,IAAA,IAAY,OAAOA,CAAK,CAAC,CAAC,OAAS,EAE9D,OACE,EAAAL,EAAA,IAAA,CAACP,EAAAA,WAAD,CACa,YACX,MAAM,EAAAO,EAAA,IAAA,CAACN,EAAAA,EAAD,CAAM,KAAK,SAAS,KAAM,EAAK,CAAA,EACrC,mBAAA,GACA,MACEU,GAAYE,GACV,EAAAN,EAAA,IAAA,CAACL,EAAAA,OAAD,CACE,QAAQ,SACR,KAAK,KACL,WAAA,GACA,UAAU,IACV,aAAW,eACX,WAAYY,GAAcC,EAC1B,YAAe,CACbF,EAAQ,EACRH,EAAM,SAAS,MAAM,CACvB,CACD,CAAA,EACC,IAAA,GAGN,UAAA,EAAAH,EAAA,IAAA,CAAC,QAAD,CACE,IAAM,GAAS,CACb,EAAM,QAAUS,EACZ,OAAOC,GAAQ,WAAYA,EAAID,CAAI,EAC9BC,IAAK,EAAI,QAAUD,EAC9B,EACA,KAAK,SACE,QACM,cACb,SAAUF,GAAcC,EACxB,YAAWG,EACX,UAAU,iCACV,UAAY,GAAU,CAChBC,EAAM,MAAQ,UAAYN,GAASA,EAAQ,EAC/CO,IAAYD,CAAK,CACnB,EACA,GAAIV,CACL,CAAA,CACS,CAAA,CAEhB,CAAC,E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/SearchField/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,mBAAmB,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/SearchField/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAIrE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,oBAAoB,CAAC;AAC5B,OAAO,aAAa,CAAC;AAErB,MAAM,WAAW,gBACf,SAAQ,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACpE,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,+CAA+C;IAC/C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,gFAAgF;AAChF,eAAO,MAAM,WAAW,+GA2DtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SearchField/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,mBAAmB,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SearchField/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAIrE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,oBAAoB,CAAC;AAC5B,OAAO,aAAa,CAAC;AAErB,MAAM,WAAW,gBACf,SAAQ,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACpE,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,+CAA+C;IAC/C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,gFAAgF;AAChF,eAAO,MAAM,WAAW,+GA2DtB,CAAC"}
|