@blockbite/ui 2.0.10 → 2.0.12
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/AutocompleteDropdown.d.ts +1 -1
- package/dist/Badge.d.ts +1 -1
- package/dist/BitePreview.d.ts +1 -1
- package/dist/Button.d.ts +1 -1
- package/dist/ButtonToggle.d.ts +1 -1
- package/dist/Chapter.d.ts +1 -1
- package/dist/ChapterDivider.d.ts +3 -2
- package/dist/Checkbox.d.ts +1 -1
- package/dist/DisappearingMessage.d.ts +1 -1
- package/dist/DropdownPicker.d.ts +1 -1
- package/dist/EmptyState.d.ts +1 -1
- package/dist/FloatingPanel.d.ts +1 -1
- package/dist/FocalPointControl.d.ts +1 -1
- package/dist/Icon.d.ts +1 -1
- package/dist/LinkPicker.d.ts +1 -1
- package/dist/MediaPicker.d.ts +1 -1
- package/dist/MetricsControl.d.ts +1 -1
- package/dist/Modal.d.ts +1 -1
- package/dist/NewWindowPortal.d.ts +1 -1
- package/dist/Notice.d.ts +1 -1
- package/dist/PasswordInput.d.ts +1 -1
- package/dist/Popover.d.ts +1 -1
- package/dist/ProjectsNavigation.d.ts +14 -0
- package/dist/RangeSlider.d.ts +1 -1
- package/dist/ResponsiveImage.d.ts +1 -1
- package/dist/ResponsiveVideo.d.ts +1 -1
- package/dist/ScrollList.d.ts +1 -1
- package/dist/SectionList.d.ts +1 -1
- package/dist/SelectControlWrapper.d.ts +1 -1
- package/dist/SingleBlockTypeAppender.d.ts +1 -1
- package/dist/SlideIn.d.ts +1 -1
- package/dist/Spinner.d.ts +1 -1
- package/dist/Tabs.d.ts +1 -1
- package/dist/Tag.d.ts +1 -1
- package/dist/TextControl.d.ts +1 -1
- package/dist/TextControlLabel.d.ts +1 -1
- package/dist/ToggleGroup.d.ts +1 -1
- package/dist/ToggleSwitch.d.ts +1 -1
- package/dist/Wrap.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3579 -49
- package/dist/index.js.map +1 -1
- package/dist/ui.css +1 -66
- package/dist/vite.svg +1 -0
- package/package.json +14 -11
- package/dist/AutocompleteDropdown.js +0 -37
- package/dist/AutocompleteDropdown.js.map +0 -1
- package/dist/Badge.js +0 -7
- package/dist/Badge.js.map +0 -1
- package/dist/BitePreview.js +0 -56
- package/dist/BitePreview.js.map +0 -1
- package/dist/Button.js +0 -13
- package/dist/Button.js.map +0 -1
- package/dist/ButtonToggle.js +0 -52
- package/dist/ButtonToggle.js.map +0 -1
- package/dist/Chapter.js +0 -10
- package/dist/Chapter.js.map +0 -1
- package/dist/ChapterDivider.js +0 -11
- package/dist/ChapterDivider.js.map +0 -1
- package/dist/Checkbox.js +0 -14
- package/dist/Checkbox.js.map +0 -1
- package/dist/DisappearingMessage.js +0 -29
- package/dist/DisappearingMessage.js.map +0 -1
- package/dist/DropdownPicker.js +0 -37
- package/dist/DropdownPicker.js.map +0 -1
- package/dist/EmptyState.js +0 -24
- package/dist/EmptyState.js.map +0 -1
- package/dist/FloatingPanel.js +0 -36
- package/dist/FloatingPanel.js.map +0 -1
- package/dist/FocalPointControl.js +0 -33
- package/dist/FocalPointControl.js.map +0 -1
- package/dist/Icon.js +0 -11
- package/dist/Icon.js.map +0 -1
- package/dist/LinkPicker.js +0 -58
- package/dist/LinkPicker.js.map +0 -1
- package/dist/MediaPicker.js +0 -106
- package/dist/MediaPicker.js.map +0 -1
- package/dist/MetricsControl.js +0 -97
- package/dist/MetricsControl.js.map +0 -1
- package/dist/Modal.js +0 -83
- package/dist/Modal.js.map +0 -1
- package/dist/NewWindowPortal.js +0 -56
- package/dist/NewWindowPortal.js.map +0 -1
- package/dist/Notice.js +0 -11
- package/dist/Notice.js.map +0 -1
- package/dist/PasswordInput.js +0 -26
- package/dist/PasswordInput.js.map +0 -1
- package/dist/Popover.js +0 -29
- package/dist/Popover.js.map +0 -1
- package/dist/RangeSlider.js +0 -43
- package/dist/RangeSlider.js.map +0 -1
- package/dist/ResponsiveImage.js +0 -19
- package/dist/ResponsiveImage.js.map +0 -1
- package/dist/ResponsiveVideo.js +0 -10
- package/dist/ResponsiveVideo.js.map +0 -1
- package/dist/ScrollList.js +0 -10
- package/dist/ScrollList.js.map +0 -1
- package/dist/SectionList.js +0 -71
- package/dist/SectionList.js.map +0 -1
- package/dist/SelectControlWrapper.js +0 -21
- package/dist/SelectControlWrapper.js.map +0 -1
- package/dist/SingleBlockTypeAppender.js +0 -19
- package/dist/SingleBlockTypeAppender.js.map +0 -1
- package/dist/SlideIn.js +0 -18
- package/dist/SlideIn.js.map +0 -1
- package/dist/Spinner.js +0 -18
- package/dist/Spinner.js.map +0 -1
- package/dist/Tabs.js +0 -56
- package/dist/Tabs.js.map +0 -1
- package/dist/Tag.js +0 -8
- package/dist/Tag.js.map +0 -1
- package/dist/TextControl.js +0 -22
- package/dist/TextControl.js.map +0 -1
- package/dist/TextControlLabel.js +0 -14
- package/dist/TextControlLabel.js.map +0 -1
- package/dist/ToggleGroup.js +0 -18
- package/dist/ToggleGroup.js.map +0 -1
- package/dist/ToggleSwitch.js +0 -19
- package/dist/ToggleSwitch.js.map +0 -1
- package/dist/Wrap.js +0 -10
- package/dist/Wrap.js.map +0 -1
- package/dist/types.js +0 -2
- package/dist/types.js.map +0 -1
package/dist/ui.css
CHANGED
|
@@ -1,66 +1 @@
|
|
|
1
|
-
/*
|
|
2
|
-
only used to target children of the UI components
|
|
3
|
-
in favour of [&>.chidren] selector within components
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/* TextControl.tsx */
|
|
7
|
-
.blockbite-ui__text-control-label {
|
|
8
|
-
input {
|
|
9
|
-
@apply mb-1 appearance-none rounded-none !border-0 border-b-2 border-l-2 border-wordpress bg-transparent p-1 text-[13px] font-bold focus:border-b-2;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/* DropdownPicker.tsx */
|
|
14
|
-
.blockbite-ui__dropdown-picker {
|
|
15
|
-
.components-button {
|
|
16
|
-
@apply !h-[32px];
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/* Modal.tsx */
|
|
21
|
-
.blockbite-ui__modal .components-modal__content {
|
|
22
|
-
padding: 1rem;
|
|
23
|
-
padding-bottom: 4rem;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/* ButtonToggle.tsx */
|
|
27
|
-
.blockbite-ui__button-group--tabs {
|
|
28
|
-
.blockbite-ui__button--default {
|
|
29
|
-
@apply h-[40px] rounded-none !border-x-0 !border-t-0 border-b-2;
|
|
30
|
-
&.is-pressed {
|
|
31
|
-
@apply !border-x-0 !border-b-2;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/* Popover.tsx */
|
|
37
|
-
.blockbite-ui__popover {
|
|
38
|
-
.components-popover__content {
|
|
39
|
-
@apply w-full;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/* Button.tsx */
|
|
44
|
-
.blockbite-ui__button--default {
|
|
45
|
-
@apply !rounded-sm !border-[0.1px] border-solid !border-grey !p-2 !text-[12px] !font-light !text-black !shadow-none hover:bg-easy;
|
|
46
|
-
&.is-pressed {
|
|
47
|
-
@apply border !border-wordpress !bg-transparent !text-wordpress;
|
|
48
|
-
}
|
|
49
|
-
.blockbite--icon {
|
|
50
|
-
@apply scale-[1.2];
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
.blockbite-ui__button {
|
|
54
|
-
&.is-icon {
|
|
55
|
-
@apply h-[30px] w-[30px];
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
/* Large Round Button for nav landings */
|
|
59
|
-
.blockbite-ui__button--rounded {
|
|
60
|
-
@apply flex !h-14 !w-14 items-center justify-center !rounded-full border !border-black bg-easy !text-black hover:bg-slate-300;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/* Checkbox.tsx */
|
|
64
|
-
.blockbite-ui__checkbox span {
|
|
65
|
-
@apply !font-sans !text-[12px] !font-normal !text-black;
|
|
66
|
-
}
|
|
1
|
+
*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.bb_ .\!visible{visibility:visible!important}.bb_ .visible{visibility:visible}.bb_ .fixed{position:fixed}.bb_ .absolute{position:absolute}.bb_ .relative{position:relative}.bb_ .bottom-0{bottom:0}.bb_ .left-0{left:0}.bb_ .right-0{right:0}.bb_ .right-1{right:.25rem}.bb_ .top-0{top:0}.bb_ .top-1{top:.25rem}.bb_ .top-2{top:.5rem}.bb_ .z-\[9999\]{z-index:9999}.bb_ .col-span-2{grid-column:span 2 / span 2}.bb_ .\!m-0{margin:0!important}.bb_ .m-0{margin:0}.bb_ .mx-1{margin-left:.25rem;margin-right:.25rem}.bb_ .mx-auto{margin-left:auto;margin-right:auto}.bb_ .my-2{margin-top:.5rem;margin-bottom:.5rem}.bb_ .\!mb-0{margin-bottom:0!important}.bb_ .\!mr-2{margin-right:.5rem!important}.bb_ .mb-4{margin-bottom:1rem}.bb_ .mr-3{margin-right:.75rem}.bb_ .mt-1{margin-top:.25rem}.bb_ .mt-2{margin-top:.5rem}.bb_ .mt-4{margin-top:1rem}.bb_ .block{display:block}.bb_ .flex{display:flex}.bb_ .inline-flex{display:inline-flex}.bb_ .grid{display:grid}.bb_ .aspect-1\/1{aspect-ratio:1 / 1}.bb_ .aspect-16\/10{aspect-ratio:16 / 10}.bb_ .aspect-16\/9{aspect-ratio:16 / 9}.bb_ .aspect-2\/1{aspect-ratio:2 / 1}.bb_ .aspect-21\/9{aspect-ratio:21 / 9}.bb_ .aspect-3\/4{aspect-ratio:3 / 4}.bb_ .aspect-4\/3{aspect-ratio:4 / 3}.bb_ .aspect-5\/4{aspect-ratio:5 / 4}.bb_ .h-12{height:3rem}.bb_ .h-3{height:.75rem}.bb_ .h-4{height:1rem}.bb_ .h-5{height:1.25rem}.bb_ .h-\[1px\]{height:1px}.bb_ .h-\[200px\]{height:200px}.bb_ .h-\[300px\]{height:300px}.bb_ .h-\[32px\]{height:32px}.bb_ .h-\[400px\]{height:400px}.bb_ .h-\[4rem\]{height:4rem}.bb_ .h-\[550px\]{height:550px}.bb_ .h-\[calc\(100\%-80px\)\]{height:calc(100% - 80px)}.bb_ .h-full{height:100%}.bb_ .w-12{width:3rem}.bb_ .w-3{width:.75rem}.bb_ .w-4{width:1rem}.bb_ .w-5{width:1.25rem}.bb_ .w-52{width:13rem}.bb_ .w-\[200px\]{width:200px}.bb_ .w-\[300px\]{width:300px}.bb_ .w-\[400px\]{width:400px}.bb_ .w-\[75px\]{width:75px}.bb_ .w-full{width:100%}.bb_ .min-w-\[240px\]{min-width:240px}.bb_ .max-w-sm{max-width:24rem}.bb_ .shrink-0{flex-shrink:0}.bb_ .grow{flex-grow:1}.bb_ .-translate-x-full{--tw-translate-x: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.bb_ .translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.bb_ .scale-10{--tw-scale-x: .1;--tw-scale-y: .1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.bb_ .scale-20{--tw-scale-x: .2;--tw-scale-y: .2;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.bb_ .scale-30{--tw-scale-x: .3;--tw-scale-y: .3;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.bb_ .scale-40{--tw-scale-x: .4;--tw-scale-y: .4;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.bb_ .scale-50{--tw-scale-x: .5;--tw-scale-y: .5;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.bb_ .scale-60{--tw-scale-x: .6;--tw-scale-y: .6;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.bb_ .scale-70{--tw-scale-x: .7;--tw-scale-y: .7;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.bb_ .scale-80{--tw-scale-x: .8;--tw-scale-y: .8;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.bb_ .scale-90{--tw-scale-x: .9;--tw-scale-y: .9;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.bb_ .transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.bb_ .cursor-move{cursor:move}.bb_ .cursor-pointer{cursor:pointer}.bb_ .grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.bb_ .flex-row{flex-direction:row}.bb_ .flex-col{flex-direction:column}.bb_ .flex-wrap{flex-wrap:wrap}.bb_ .items-center{align-items:center}.bb_ .items-baseline{align-items:baseline}.bb_ .justify-end{justify-content:flex-end}.bb_ .justify-center{justify-content:center}.bb_ .justify-between{justify-content:space-between}.bb_ .gap-1{gap:.25rem}.bb_ .gap-2{gap:.5rem}.bb_ :is(.space-x-2>:not([hidden])~:not([hidden])){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.bb_ :is(.space-y-1\.5>:not([hidden])~:not([hidden])){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.bb_ :is(.divide-y>:not([hidden])~:not([hidden])){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.bb_ .overflow-auto{overflow:auto}.bb_ .overflow-y-auto{overflow-y:auto}.bb_ .overflow-y-scroll{overflow-y:scroll}.bb_ .truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bb_ .\!rounded-none{border-radius:0!important}.bb_ .rounded{border-radius:.25rem}.bb_ .rounded-2xl{border-radius:1rem}.bb_ .rounded-full{border-radius:9999px}.bb_ .border{border-width:1px}.bb_ .border-b{border-bottom-width:1px}.bb_ .border-l-4{border-left-width:4px}.bb_ .border-r{border-right-width:1px}.bb_ .border-t{border-top-width:1px}.bb_ .border-blue-500{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.bb_ .border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.bb_ .border-transparent{border-color:transparent}.bb_ .border-opacity-70{--tw-border-opacity: .7}.bb_ .\!bg-transparent{background-color:transparent!important}.bb_ .bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bb_ .bg-easy{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.bb_ .bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bb_ .bg-gray-300{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.bb_ .bg-slate-300{--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity, 1))}.bb_ .bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bb_ .bg-opacity-50{--tw-bg-opacity: .5}.bb_ .\!p-0{padding:0!important}.bb_ .p-0{padding:0}.bb_ .p-2{padding:.5rem}.bb_ .p-4{padding:1rem}.bb_ .px-1{padding-left:.25rem;padding-right:.25rem}.bb_ .px-2\.5{padding-left:.625rem;padding-right:.625rem}.bb_ .px-3{padding-left:.75rem;padding-right:.75rem}.bb_ .px-4{padding-left:1rem;padding-right:1rem}.bb_ .py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.bb_ .py-2{padding-top:.5rem;padding-bottom:.5rem}.bb_ .py-px{padding-top:1px;padding-bottom:1px}.bb_ .\!pt-2{padding-top:.5rem!important}.bb_ .pb-2{padding-bottom:.5rem}.bb_ .pb-4{padding-bottom:1rem}.bb_ .text-left{text-align:left}.bb_ .text-center{text-align:center}.bb_ .\!font-sans{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif,sans-serif!important}.bb_ .\!text-\[11px\]{font-size:11px!important}.bb_ .text-2xl{font-size:1.5rem;line-height:2rem}.bb_ .text-\[\.65rem\]{font-size:.65rem}.bb_ .text-\[12px\]{font-size:12px}.bb_ .text-sm{font-size:.875rem;line-height:1.25rem}.bb_ .text-sm\/6{font-size:.875rem;line-height:1.5rem}.bb_ .text-xs{font-size:.75rem;line-height:1rem}.bb_ .font-bold{font-weight:700}.bb_ .font-medium{font-weight:500}.bb_ .font-semibold{font-weight:600}.bb_ .\!text-current{color:currentColor!important}.bb_ .\!text-gray-400{--tw-text-opacity: 1 !important;color:rgb(156 163 175 / var(--tw-text-opacity, 1))!important}.bb_ .\!text-gray-500{--tw-text-opacity: 1 !important;color:rgb(107 114 128 / var(--tw-text-opacity, 1))!important}.bb_ .text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.bb_ .text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.bb_ .shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.bb_ .shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.bb_ .-outline-offset-2{outline-offset:-2px}.bb_ .outline-black{outline-color:#2b2b2a}.bb_ .filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.bb_ .transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.bb_ .ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.blockbite-ui__text-control-label input{margin-bottom:.25rem}.blockbite-ui__text-control-label input{-webkit-appearance:none;-moz-appearance:none;appearance:none}.blockbite-ui__text-control-label input{border-radius:0}.blockbite-ui__text-control-label input{border-width:0px!important}.blockbite-ui__text-control-label input{border-bottom-width:2px}.blockbite-ui__text-control-label input{border-left-width:2px}.blockbite-ui__text-control-label input{border-color:var(--wp-admin-theme-color)}.blockbite-ui__text-control-label input{background-color:transparent}.blockbite-ui__text-control-label input{padding:.25rem}.blockbite-ui__text-control-label input{font-size:13px}.blockbite-ui__text-control-label input{font-weight:700}.blockbite-ui__text-control-label input:focus{border-bottom-width:2px}.blockbite-ui__dropdown-picker .components-button{height:32px!important}.blockbite-ui__modal .components-modal__content{padding:1rem 1rem 4rem}.blockbite-ui__button-group--tabs .blockbite-ui__button--default{height:40px}.blockbite-ui__button-group--tabs .blockbite-ui__button--default{border-radius:0}.blockbite-ui__button-group--tabs .blockbite-ui__button--default{border-left-width:0px!important;border-right-width:0px!important}.blockbite-ui__button-group--tabs .blockbite-ui__button--default{border-top-width:0px!important}.blockbite-ui__button-group--tabs .blockbite-ui__button--default{border-bottom-width:2px}.blockbite-ui__button-group--tabs .blockbite-ui__button--default.is-pressed{border-left-width:0px!important;border-right-width:0px!important}.blockbite-ui__button-group--tabs .blockbite-ui__button--default.is-pressed{border-bottom-width:2px!important}.blockbite-ui__popover .components-popover__content{width:100%}.blockbite-ui__button--default{border-radius:.125rem!important;border-width:.1px!important;border-style:solid;--tw-border-opacity: 1 !important;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1))!important;padding:.5rem!important;font-size:12px!important;font-weight:300!important;--tw-text-opacity: 1 !important;color:rgb(43 43 42 / var(--tw-text-opacity, 1))!important;--tw-shadow: 0 0 #0000 !important;--tw-shadow-colored: 0 0 #0000 !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.blockbite-ui__button--default:hover{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.blockbite-ui__button--default.is-pressed{border-width:1px}.blockbite-ui__button--default.is-pressed{border-color:var(--wp-admin-theme-color)!important}.blockbite-ui__button--default.is-pressed{background-color:transparent!important}.blockbite-ui__button--default.is-pressed{color:var(--wp-admin-theme-color)!important}.blockbite-ui__button--default .blockbite--icon{--tw-scale-x: 1.2;--tw-scale-y: 1.2;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.blockbite-ui__button.is-icon{height:30px}.blockbite-ui__button.is-icon{width:30px}.blockbite-ui__button--rounded{display:flex;height:3.5rem!important;width:3.5rem!important;align-items:center;justify-content:center;border-radius:9999px!important;border-width:1px;--tw-border-opacity: 1 !important;border-color:rgb(43 43 42 / var(--tw-border-opacity, 1))!important;--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1 !important;color:rgb(43 43 42 / var(--tw-text-opacity, 1))!important}.blockbite-ui__button--rounded:hover{--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity, 1))}.blockbite-ui__checkbox span{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif,sans-serif!important;font-size:12px!important;font-weight:400!important;--tw-text-opacity: 1 !important;color:rgb(43 43 42 / var(--tw-text-opacity, 1))!important}.bb_ .hover\:bg-easy:hover{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.bb_ .hover\:text-wordpress:hover{color:var(--wp-admin-theme-color)}.bb_ .focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.bb_ .focus\:ring-0:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}@media (min-width: 640px){.bb_ .sm\:text-left{text-align:left}}
|
package/dist/vite.svg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
package/package.json
CHANGED
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blockbite/ui",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.12",
|
|
4
4
|
"description": "Shared React UI components for Blockbite apps",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
|
+
"style": "./dist/ui.css",
|
|
7
8
|
"exports": {
|
|
8
9
|
".": {
|
|
9
10
|
"import": "./dist/index.js",
|
|
10
11
|
"require": "./dist/index.js",
|
|
11
12
|
"types": "./dist/index.d.ts",
|
|
12
13
|
"default": "./dist/index.js"
|
|
13
|
-
},
|
|
14
|
-
"./components/*": {
|
|
15
|
-
"import": "./dist/index.js",
|
|
16
|
-
"require": "./dist/index.js",
|
|
17
|
-
"types": "./dist/index.d.ts",
|
|
18
|
-
"default": "./dist/index.js"
|
|
19
14
|
}
|
|
20
15
|
},
|
|
21
16
|
"files": [
|
|
@@ -38,7 +33,8 @@
|
|
|
38
33
|
"@wordpress/primitives": "^4.22.0",
|
|
39
34
|
"classnames": "^2.5.1",
|
|
40
35
|
"lodash": "^4.17.21",
|
|
41
|
-
"@blockbite/icons": "4.4.
|
|
36
|
+
"@blockbite/icons": "4.4.15",
|
|
37
|
+
"@blockbite/shared-utils": "2.0.0"
|
|
42
38
|
},
|
|
43
39
|
"peerDependencies": {
|
|
44
40
|
"@wordpress/components": "^29.7.0",
|
|
@@ -52,12 +48,19 @@
|
|
|
52
48
|
"@types/react-dom": "^18.2.19",
|
|
53
49
|
"@types/wordpress__block-editor": "^11.5.16",
|
|
54
50
|
"@types/wordpress__blocks": "^12.5.17",
|
|
55
|
-
"
|
|
51
|
+
"@vitejs/plugin-react": "^4.4.1",
|
|
52
|
+
"autoprefixer": "^10.4.19",
|
|
53
|
+
"postcss": "^8.4.38",
|
|
54
|
+
"postcss-nested": "^7.0.2",
|
|
55
|
+
"tailwindcss": "^3.4.17",
|
|
56
|
+
"typescript": "^5.8.3",
|
|
57
|
+
"vite": "^6.3.4",
|
|
58
|
+
"vite-plugin-dts": "^4.5.3"
|
|
56
59
|
},
|
|
57
60
|
"scripts": {
|
|
58
|
-
"
|
|
61
|
+
"dev": "npm run generate-index && vite build --watch",
|
|
59
62
|
"generate-index": "node ./generate-index.cjs",
|
|
60
|
-
"build": "npm run generate-index &&
|
|
63
|
+
"build": "npm run generate-index && vite build",
|
|
61
64
|
"type-check": "tsc --noEmit"
|
|
62
65
|
}
|
|
63
66
|
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
void React;
|
|
3
|
-
import { Pencil1 as Pencil1Icon } from '@blockbite/icons';
|
|
4
|
-
import { Button, Dropdown, TextControl } from '@wordpress/components';
|
|
5
|
-
import { useEffect, useState } from '@wordpress/element';
|
|
6
|
-
import classNames from 'classnames';
|
|
7
|
-
import { ButtonToggle } from './ButtonToggle.js';
|
|
8
|
-
import { Wrap } from './Wrap.js';
|
|
9
|
-
export function AutocompleteDropdown({ defaultValue, options, swatch, onPressedChange, }) {
|
|
10
|
-
const [activeKeyword, setActiveKeyword] = useState('');
|
|
11
|
-
const [filteredOptions, setFilteredOptions] = useState([]);
|
|
12
|
-
useEffect(() => {
|
|
13
|
-
setFilteredOptions(options.filter((option) => option.label.toLowerCase().includes(activeKeyword.toLowerCase())));
|
|
14
|
-
}, [activeKeyword, options]);
|
|
15
|
-
useEffect(() => {
|
|
16
|
-
setActiveKeyword('');
|
|
17
|
-
setFilteredOptions(options);
|
|
18
|
-
}, [defaultValue, options]);
|
|
19
|
-
return (React.createElement(Dropdown, { className: "option-panel-dropdown", contentClassName: "option-panel-dropdown-content", popoverProps: { placement: 'bottom-start' }, renderToggle: ({ isOpen, onToggle }) => (React.createElement(Wrap, { important: true },
|
|
20
|
-
React.createElement(Button, { variant: "secondary", size: "small", onClick: onToggle, "aria-expanded": isOpen },
|
|
21
|
-
React.createElement("div", { className: "flex items-center gap-1 !bg-transparent !p-0 !text-[11px] !text-current" },
|
|
22
|
-
swatch && (React.createElement("div", { className: classNames(`h-3 w-3 rounded-full bg-${defaultValue}`) })),
|
|
23
|
-
React.createElement("span", null, defaultValue || 'Select option…'),
|
|
24
|
-
React.createElement(Pencil1Icon, null))))), renderContent: () => (React.createElement(Wrap, { important: true },
|
|
25
|
-
React.createElement("div", { className: "w-52" },
|
|
26
|
-
React.createElement(TextControl, { label: "Search options", value: activeKeyword, onChange: (value) => setActiveKeyword(value), autoComplete: "off" }),
|
|
27
|
-
React.createElement("div", { className: "grid grid-cols-2 gap-1 !bg-transparent !p-0 !pt-2" },
|
|
28
|
-
filteredOptions.length === 0 && (React.createElement("div", { className: "!text-gray-medium col-span-2 pb-2 text-center !text-[11px]" }, "No options found.")),
|
|
29
|
-
filteredOptions.map((option, index) => (React.createElement(ButtonToggle, { key: `ButtonToggle__${option.value}___${index}`, className: classNames({
|
|
30
|
-
'bg-primary': option.value,
|
|
31
|
-
}), size: "small", value: option.value.toString(), defaultPressed: defaultValue, onPressedChange: (value) => {
|
|
32
|
-
onPressedChange(value ? option.value : '');
|
|
33
|
-
} },
|
|
34
|
-
swatch && (React.createElement("div", { className: classNames(`mr-3 h-3 w-3 rounded-full bg-${option.value}`) })),
|
|
35
|
-
option.label))))))) }));
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=AutocompleteDropdown.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AutocompleteDropdown.js","sourceRoot":"","sources":["../src/AutocompleteDropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,KAAK,KAAK,CAAC;AAEX,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AASjC,MAAM,UAAU,oBAAoB,CAAC,EACnC,YAAY,EACZ,OAAO,EACP,MAAM,EACN,eAAe,GACU;IACzB,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IACvD,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,QAAQ,CAAgB,EAAE,CAAC,CAAC;IAE1E,SAAS,CAAC,GAAG,EAAE;QACb,kBAAkB,CAChB,OAAO,CAAC,MAAM,CAAC,CAAC,MAAmB,EAAE,EAAE,CACrC,MAAM,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC,WAAW,EAA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G,CAAC,CAAC,MAAmB,EAAE,KAAa,EAAE,EAAE,CAAC,CAC3D,oBAAC,YAAY,IACX,GAAG,EAAE,iBAAiB,MAAM,CAAC,KAAK,MAAM,KAAK,EAAE,EAC/C,SAAS,EAAE,UAAU,CAAC;4BACpB,YAAY,EAAE,MAAM,CAAC,KAAK;yBAC3B,CAAC,EACF,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,EAC9B,cAAc,EAAE,YAAY,EAC5B,eAAe,EAAE,CAAC,KAAa,EAAE,EAAE;4BACjC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;wBAC7C,CAAC;wBAEA,MAAM,IAAI,CACT,6BACE,SAAS,EAAE,UAAU,CACnB,gCAAgC,MAAM,CAAC,KAAK,EAAE,CAC/C,GACD,CACH;wBACA,MAAM,CAAC,KAAK,CACA,CAChB,CAAC,CACE,CACF,CACD,CACR,GACD,CACH,CAAC;AACJ,CAAC"}
|
package/dist/Badge.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import classNames from 'classnames';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
void React;
|
|
4
|
-
export const Badge = ({ children, className, onClick }) => {
|
|
5
|
-
return (React.createElement("div", { onClick: onClick, className: classNames(className, 'inline-flex items-center rounded-full bg-blue-100 px-2.5 py-0.5 text-xs font-medium text-blue-800') }, children));
|
|
6
|
-
};
|
|
7
|
-
//# sourceMappingURL=Badge.js.map
|
package/dist/Badge.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.js","sourceRoot":"","sources":["../src/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,KAAK,KAAK,CAAC;AAQX,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAc,EAAE,EAAE;IACpE,OAAO,CACL,6BACE,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,UAAU,CACnB,SAAS,EACT,mGAAmG,CACpG,IAEA,QAAQ,CACL,CACP,CAAC;AACJ,CAAC,CAAC"}
|
package/dist/BitePreview.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { createPortal, useEffect, useRef, useState } from '@wordpress/element';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
void React;
|
|
4
|
-
export const BitePreview = ({ htmlContent, cssContent, frontendAssets }) => {
|
|
5
|
-
const iframeRef = useRef(null);
|
|
6
|
-
const [iframeBody, setIframeBody] = useState(null);
|
|
7
|
-
useEffect(() => {
|
|
8
|
-
const iframe = iframeRef.current;
|
|
9
|
-
if (iframe) {
|
|
10
|
-
iframe.onload = () => {
|
|
11
|
-
const iframeDocument = iframe.contentDocument || iframe.contentWindow.document;
|
|
12
|
-
if (iframeDocument) {
|
|
13
|
-
setIframeBody(iframeDocument.body); // Set the iframe body for portal
|
|
14
|
-
// Inject CSS content directly
|
|
15
|
-
const styleTag = iframeDocument.createElement('style');
|
|
16
|
-
styleTag.innerHTML = cssContent;
|
|
17
|
-
iframeDocument.head.appendChild(styleTag);
|
|
18
|
-
// Adopt or Create Frontend Assets
|
|
19
|
-
frontendAssets.forEach(({ type, id, url }) => {
|
|
20
|
-
const existingElement = document.getElementById(id);
|
|
21
|
-
if (existingElement) {
|
|
22
|
-
// If the asset exists in the parent, move it to the iframe
|
|
23
|
-
const adoptedElement = document.adoptNode(existingElement.cloneNode(true));
|
|
24
|
-
iframeDocument.head.appendChild(adoptedElement);
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
// Create a new script or style if not found
|
|
28
|
-
const newElement = iframeDocument.createElement(type === 'script' ? 'script' : 'link');
|
|
29
|
-
newElement.id = id;
|
|
30
|
-
if (type === 'script') {
|
|
31
|
-
newElement.src = url;
|
|
32
|
-
newElement.async = true;
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
newElement.rel = 'stylesheet';
|
|
36
|
-
newElement.href = url;
|
|
37
|
-
}
|
|
38
|
-
iframeDocument.head.appendChild(newElement);
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
return () => {
|
|
45
|
-
if (iframe) {
|
|
46
|
-
iframe.onload = null; // Clean up event listener
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
}, [htmlContent, cssContent, frontendAssets]);
|
|
50
|
-
return (React.createElement("div", { className: "render-preview-container", style: { width: '100%', minHeight: '100%' } },
|
|
51
|
-
React.createElement("iframe", { ref: iframeRef, title: "Preview", className: "editor-styles-wrapper", width: "100%", height: "100%" }),
|
|
52
|
-
iframeBody &&
|
|
53
|
-
createPortal(React.createElement("div", { className: "b_" },
|
|
54
|
-
React.createElement("div", { className: "b_utils", dangerouslySetInnerHTML: { __html: htmlContent } })), iframeBody)));
|
|
55
|
-
};
|
|
56
|
-
//# sourceMappingURL=BitePreview.js.map
|
package/dist/BitePreview.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BitePreview.js","sourceRoot":"","sources":["../src/BitePreview.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,KAAK,KAAK,CAAC;AAEX,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,EAAE,EAAE,EAAE;IACzE,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IAC/B,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAEnD,SAAS,CAAC,GA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CAAC;4BAC1B,CAAC;iCAAM,CAAC;gCACN,UAAU,CAAC,GAAG,GAAG,YAAY,CAAC;gCAC9B,UAAU,CAAC,IAAI,GAAG,GAAG,CAAC;4BACxB,CAAC;4BAED,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;wBAC9C,CAAC;oBACH,CAAC,CAAC,CAAC;gBACL,CAAC;YACH,CAAC,CAAC;QACJ,CAAC;QAED,OAAO,GAAG,EAAE;YACV,IAAI,MAAM,EAAE,CAAC;gBACX,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,0BAA0B;YAClD,CAAC;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,WAAW,EAAE,UAAU,EAAE,cAAc,CAAC,CAAC,CAAC;IAE9C,OAAO,CACL,6BACE,SAAS,EAAC,0BAA0B,EACpC,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE;QAE3C,gCACE,GAAG,EAAE,SAAS,EACd,KAAK,EAAC,SAAS,EACf,SAAS,EAAC,uBAAuB,EACjC,KAAK,EAAC,MAAM,EACZ,MAAM,EAAC,MAAM,GACb;QACD,UAAU;YACT,YAAY,CACV,6BAAK,SAAS,EAAC,IAAI;gBACjB,6BACE,SAAS,EAAC,SAAS,EACnB,uBAAuB,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,GAChD,CACE,EACN,UAAU,CACX,CACC,CACP,CAAC;AACJ,CAAC,CAAC"}
|
package/dist/Button.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
void React;
|
|
3
|
-
import { Button as WordpressButton } from '@wordpress/components';
|
|
4
|
-
import classNames from 'classnames';
|
|
5
|
-
import { Icon } from './Icon.js';
|
|
6
|
-
export const Button = ({ children, size = 'default', label, className, onClick, variant = 'primary', display = 'auto', icon, disabled = false, }) => {
|
|
7
|
-
const isIconDisplay = display === 'icon' || display === 'icon-lg';
|
|
8
|
-
return (React.createElement(WordpressButton, { size: size, variant: variant, label: label, showTooltip: true, disabled: disabled, className: classNames(className, 'blockbite-ui__button', 'flex items-center justify-center gap-1', { 'is-primary': variant === 'primary' }, { 'is-secondary': variant === 'secondary' }, { 'is-link': variant === 'link' }, { 'is-tertiary': variant === 'tertiary' }, { 'is-icon': display === 'icon' }), onClick: onClick },
|
|
9
|
-
icon && (React.createElement(Icon, { icon: icon, className: classNames({ 'h-4 w-4': display === 'icon-lg' }) })),
|
|
10
|
-
!isIconDisplay ? children : null,
|
|
11
|
-
label && !children && !isIconDisplay ? React.createElement("span", null, label) : null));
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=Button.js.map
|
package/dist/Button.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../src/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,KAAK,KAAK,CAAC;AAEX,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAejC,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,EACrB,QAAQ,EACR,IAAI,GAAG,SAAS,EAChB,KAAK,EACL,SAAS,EACT,OAAO,EACP,OAAO,GAAG,SAAS,EACnB,OAAO,GAAG,MAAM,EAChB,IAAI,EACJ,QAAQ,GAAG,KAAK,GACJ,EAAE,EAAE;IAChB,MAAM,aAAa,GAAG,OAAO,KAAK,MAAM,IAAI,OAAO,KAAK,SAAS,CAAC;IAElE,OAAO,CACL,oBAAC,eAAe,IACd,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,IAAI,EACjB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,UAAU,CACnB,SAAS,EACT,sBAAsB,EACtB,wCAAwC,EACxC,EAAE,YAAY,EAAE,OAAO,KAAK,SAAS,EAAE,EACvC,EAAE,cAAc,EAAE,OAAO,KAAK,WAAW,EAAE,EAC3C,EAAE,SAAS,EAAE,OAAO,KAAK,MAAM,EAAE,EACjC,EAAE,aAAa,EAAE,OAAO,KAAK,UAAU,EAAE,EACzC,EAAE,SAAS,EAAE,OAAO,KAAK,MAAM,EAAE,CAClC,EACD,OAAO,EAAE,OAAO;QAEf,IAAI,IAAI,CACP,oBAAC,IAAI,IACH,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,UAAU,CAAC,EAAE,SAAS,EAAE,OAAO,KAAK,SAAS,EAAE,CAAC,GAC3D,CACH;QACA,CAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI;QAChC,KAAK,IAAI,CAAC,QAAQ,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,kCAAO,KAAK,CAAQ,CAAC,CAAC,CAAC,IAAI,CACnD,CACnB,CAAC;AACJ,CAAC,CAAC"}
|
package/dist/ButtonToggle.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { Button as WordpressButton } from '@wordpress/components';
|
|
2
|
-
import { memo, useCallback, useEffect, useState } from '@wordpress/element';
|
|
3
|
-
import classNames from 'classnames';
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import { Icon } from './Icon.js';
|
|
6
|
-
import { Wrap } from './Wrap.js';
|
|
7
|
-
void React;
|
|
8
|
-
export const ButtonToggle = memo(({ children, className, value, variant = 'secondary', defaultPressed, onPressedChange, icon, size = 'compact', display = 'auto', label, }) => {
|
|
9
|
-
const [isPressed, setIsPressed] = useState(false);
|
|
10
|
-
useEffect(() => {
|
|
11
|
-
setIsPressed(defaultPressed === value ? true : false);
|
|
12
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13
|
-
}, [defaultPressed]);
|
|
14
|
-
const handleClick = useCallback(() => {
|
|
15
|
-
setIsPressed((prev) => !prev);
|
|
16
|
-
onPressedChange(value);
|
|
17
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
18
|
-
}, [isPressed, onPressedChange]);
|
|
19
|
-
return (React.createElement(WordpressButton, { "aria-label": label, className: classNames(className, 'blockbite-ui__button--default'), value: value, size: size, label: label, variant: variant, showTooltip: true, isPressed: isPressed, onClick: handleClick },
|
|
20
|
-
icon && React.createElement(Icon, { icon: icon }),
|
|
21
|
-
display !== 'icon' ? children : null,
|
|
22
|
-
label && !children && display !== 'icon' ? React.createElement("span", null, label) : null));
|
|
23
|
-
});
|
|
24
|
-
export const ButtonToggleGroup = memo(({ className, defaultPressed = '', toggle = true, display = 'auto', options, size = 'compact', tabs = false, variant = 'secondary', stretch = false, onPressedChange, }) => {
|
|
25
|
-
const [isPressed, setIsPressed] = useState(defaultPressed);
|
|
26
|
-
useEffect(() => {
|
|
27
|
-
setIsPressed(defaultPressed);
|
|
28
|
-
}, [defaultPressed]);
|
|
29
|
-
const handleButtonClick = useCallback((value) => {
|
|
30
|
-
const newValue = toggle && isPressed === value ? '' : value;
|
|
31
|
-
setIsPressed(newValue);
|
|
32
|
-
onPressedChange === null || onPressedChange === void 0 ? void 0 : onPressedChange(newValue);
|
|
33
|
-
}, [isPressed, onPressedChange, toggle]);
|
|
34
|
-
const renderContent = (option) => {
|
|
35
|
-
if (display === 'icon' && (option === null || option === void 0 ? void 0 : option.icon)) {
|
|
36
|
-
return React.createElement(Icon, { icon: option.icon });
|
|
37
|
-
}
|
|
38
|
-
else if (display === 'label') {
|
|
39
|
-
return React.createElement("span", null, option.label);
|
|
40
|
-
}
|
|
41
|
-
return (React.createElement("span", { className: "flex items-center justify-center gap-1" },
|
|
42
|
-
option.icon && React.createElement(Icon, { icon: option.icon }),
|
|
43
|
-
React.createElement("span", null, option.label)));
|
|
44
|
-
};
|
|
45
|
-
return (React.createElement(Wrap, { className: classNames('blockbite-ui__button-group flex flex-wrap gap-1', className, tabs ? 'blockbite-ui__button-group--tabs' : '') }, options.map((option, index) => (React.createElement(WordpressButton, { key: `ButtonToggleGroup__${option.value}__${option.label}__${index}`, className: classNames('blockbite-ui__button--default', {
|
|
46
|
-
grow: stretch,
|
|
47
|
-
'justify-center': stretch,
|
|
48
|
-
}), "aria-label": option.label, showTooltip: true, value: option.value, size: size, label: (option === null || option === void 0 ? void 0 : option.tooltip) || option.label, variant: variant, isPressed: isPressed === option.value, onClick: () => handleButtonClick(option.value) },
|
|
49
|
-
renderContent(option),
|
|
50
|
-
option.children && option.children)))));
|
|
51
|
-
});
|
|
52
|
-
//# sourceMappingURL=ButtonToggle.js.map
|
package/dist/ButtonToggle.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonToggle.js","sourceRoot":"","sources":["../src/ButtonToggle.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,KAAK,KAAK,CAAC;AAqCX,MAAM,CAAC,MAAM,YAAY,GAAgC,IAAI,CAC3D,CAAC,EACC,QAAQ,EACR,SAAS,EACT,KAAK,EACL,OAAO,GAAG,WAAW,EACrB,cAAc,EACd,eAAe,EACf,IAAI,EACJ,IAAI,GAAG,SAAS,EAChB,OAAO,GAAG,MAAM,EAChB,KAAK,GACN,EAAE,EAAE;IACH,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAElD,SAAS,CAAC,GAAG,EAAE;QACb,YAAY,CAAC,cAAc,KAAK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,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAC9B,oBAAC,eAAe,IACd,GAAG,EAAE,sBAAsB,MAAM,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,KAAK,KAAK,EAAE,EACpE,SAAS,EAAE,UAAU,CAAC,+BAA+B,EAAE;YACrD,IAAI,EAAE,OAAO;YACb,gBAAgB,EAAE,OAAO;SAC1B,CAAC,gBAEU,MAAM,CAAC,KAAK,EACxB,WAAW,EAAE,IAAI,EACjB,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,KAAI,MAAM,CAAC,KAAK,EACtC,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,SAAS,KAAK,MAAM,CAAC,KAAK,EACrC,OAAO,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,MAAM,CAAC,KAAK,CAAC;QAE7C,aAAa,CAAC,MAAM,CAAC;QACrB,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,CACnB,CACnB,CAAC,CACG,CACR,CAAC;AACJ,CAAC,CACF,CAAC"}
|
package/dist/Chapter.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import classNames from 'classnames';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { Wrap } from './Wrap.js';
|
|
4
|
-
void React;
|
|
5
|
-
export const Chapter = ({ children, title }) => {
|
|
6
|
-
return (React.createElement(Wrap, { className: classNames('text-gray-medium my-2 flex items-center gap-1 text-[12px] font-medium', classNames) },
|
|
7
|
-
title && React.createElement(Wrap, { className: "font-medium" }, title),
|
|
8
|
-
children));
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=Chapter.js.map
|
package/dist/Chapter.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Chapter.js","sourceRoot":"","sources":["../src/Chapter.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,KAAK,KAAK,CAAC;AAQX,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAgB,EAAE,EAAE;IAC3D,OAAO,CACL,oBAAC,IAAI,IACH,SAAS,EAAE,UAAU,CACnB,uEAAuE,EACvE,UAAU,CACX;QAEA,KAAK,IAAI,oBAAC,IAAI,IAAC,SAAS,EAAC,aAAa,IAAE,KAAK,CAAQ;QACrD,QAAQ,CACJ,CACR,CAAC;AACJ,CAAC,CAAC"}
|
package/dist/ChapterDivider.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import classNames from 'classnames';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
void React;
|
|
4
|
-
export const ChapterDivider = ({ id = '', title, className, help, }) => {
|
|
5
|
-
return (React.createElement("div", Object.assign({}, (id ? { id } : null), { className: classNames('mb-4', className) }),
|
|
6
|
-
React.createElement("div", { className: "flex w-full flex-wrap items-center gap-2" },
|
|
7
|
-
React.createElement("small", { className: "shrink-1 text-[12px]" }, title),
|
|
8
|
-
React.createElement("span", { className: "h-[1px] w-full bg-easy" })),
|
|
9
|
-
help && React.createElement("small", { className: "w-full shrink-0 text-[12px]" }, help)));
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=ChapterDivider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ChapterDivider.js","sourceRoot":"","sources":["../src/ChapterDivider.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,KAAK,KAAK,CAAC;AASX,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAC7B,EAAE,GAAG,EAAE,EACP,KAAK,EACL,SAAS,EACT,IAAI,GACgB,EAAE,EAAE;IACxB,OAAO,CACL,6CAAS,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAE,SAAS,EAAE,UAAU,CAAC,MAAM,EAAE,SAAS,CAAC;QACrE,6BAAK,SAAS,EAAC,0CAA0C;YACvD,+BAAO,SAAS,EAAC,sBAAsB,IAAE,KAAK,CAAS;YACvD,8BAAM,SAAS,EAAC,wBAAwB,GAAQ,CAC5C;QACL,IAAI,IAAI,+BAAO,SAAS,EAAC,6BAA6B,IAAE,IAAI,CAAS,CAClE,CACP,CAAC;AACJ,CAAC,CAAC"}
|
package/dist/Checkbox.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { CheckboxControl } from '@wordpress/components';
|
|
2
|
-
import { useEffect, useState } from '@wordpress/element';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { Wrap } from './Wrap.js';
|
|
5
|
-
void React;
|
|
6
|
-
export const Checkbox = ({ label, help, defaultChecked }) => {
|
|
7
|
-
const [isChecked, setChecked] = useState(defaultChecked);
|
|
8
|
-
useEffect(() => {
|
|
9
|
-
setChecked(defaultChecked);
|
|
10
|
-
}, [defaultChecked]);
|
|
11
|
-
return (React.createElement(Wrap, { className: "blockbite-ui__checkbox mx-1 flex items-center gap-2" },
|
|
12
|
-
React.createElement(CheckboxControl, { label: label, help: help, checked: isChecked, onChange: setChecked })));
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=Checkbox.js.map
|
package/dist/Checkbox.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../src/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,KAAK,KAAK,CAAC;AAUX,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,cAAc,EAAiB,EAAE,EAAE;IACzE,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,cAAc,CAAC,CAAC;IAEzD,SAAS,CAAC,GAAG,EAAE;QACb,UAAU,CAAC,cAAc,CAAC,CAAC;IAC7B,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;IAErB,OAAO,CACL,oBAAC,IAAI,IAAC,SAAS,EAAC,qDAAqD;QACnE,oBAAC,eAAe,IACd,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,SAAS,EAClB,QAAQ,EAAE,UAAU,GACpB,CACG,CACR,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { useEffect, useRef, useState } from '@wordpress/element';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
void React;
|
|
4
|
-
export const DisappearingMessage = ({ duration, children, trigger, }) => {
|
|
5
|
-
const [alert, setAlert] = useState(false);
|
|
6
|
-
const isMountingRef = useRef(false);
|
|
7
|
-
useEffect(() => {
|
|
8
|
-
isMountingRef.current = true;
|
|
9
|
-
}, []);
|
|
10
|
-
useEffect(() => {
|
|
11
|
-
let timeoutId = null;
|
|
12
|
-
// Only run on subsequent renders
|
|
13
|
-
if (trigger && !isMountingRef.current) {
|
|
14
|
-
setAlert(true);
|
|
15
|
-
timeoutId = setTimeout(() => {
|
|
16
|
-
setAlert(false);
|
|
17
|
-
}, duration);
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
isMountingRef.current = false;
|
|
21
|
-
}
|
|
22
|
-
// Cleanup timeout on unmount or when `trigger` changes
|
|
23
|
-
return () => {
|
|
24
|
-
clearTimeout(timeoutId);
|
|
25
|
-
};
|
|
26
|
-
}, [trigger, duration]);
|
|
27
|
-
return alert && React.createElement(React.Fragment, null, children);
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=DisappearingMessage.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DisappearingMessage.js","sourceRoot":"","sources":["../src/DisappearingMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,KAAK,KAAK,CAAC;AAQX,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,EAClC,QAAQ,EACR,QAAQ,EACR,OAAO,GACkB,EAAE,EAAE;IAC7B,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC1C,MAAM,aAAa,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAEpC,SAAS,CAAC,GAAG,EAAE;QACb,aAAa,CAAC,OAAO,GAAG,IAAI,CAAC;IAC/B,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,SAAS,GAAG,IAAI,CAAC;QAErB,iCAAiC;QACjC,IAAI,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC;YACtC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACf,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE;gBAC1B,QAAQ,CAAC,KAAK,CAAC,CAAC;YAClB,CAAC,EAAE,QAAQ,CAAC,CAAC;QACf,CAAC;aAAM,CAAC;YACN,aAAa,CAAC,OAAO,GAAG,KAAK,CAAC;QAChC,CAAC;QAED,uDAAuD;QACvD,OAAO,GAAG,EAAE;YACV,YAAY,CAAC,SAAS,CAAC,CAAC;QAC1B,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;IAExB,OAAO,KAAK,IAAI,0CAAG,QAAQ,CAAI,CAAC;AAClC,CAAC,CAAC"}
|
package/dist/DropdownPicker.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { ChevronDown as ChevronDownIcon } from '@blockbite/icons';
|
|
2
|
-
import { DropdownMenu } from '@wordpress/components';
|
|
3
|
-
import { useEffect, useState } from '@wordpress/element';
|
|
4
|
-
import classNames from 'classnames';
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import { Icon } from './Icon.js';
|
|
7
|
-
void React;
|
|
8
|
-
export const DropdownPicker = ({ label, className, defaultValue, defaultIcon = ChevronDownIcon, onPressedChange, options, }) => {
|
|
9
|
-
var _a;
|
|
10
|
-
const [currentOption, setCurrentOption] = useState(null);
|
|
11
|
-
useEffect(() => {
|
|
12
|
-
setCurrentOption(defaultValue);
|
|
13
|
-
}, [defaultValue]);
|
|
14
|
-
const allOptions = [
|
|
15
|
-
...options.map((option) => ({
|
|
16
|
-
icon: option.icon,
|
|
17
|
-
label: option.label,
|
|
18
|
-
title: option.label,
|
|
19
|
-
value: option.value,
|
|
20
|
-
onClick: () => {
|
|
21
|
-
setCurrentOption(option.value);
|
|
22
|
-
onPressedChange(option.value);
|
|
23
|
-
},
|
|
24
|
-
})),
|
|
25
|
-
{
|
|
26
|
-
icon: React.createElement(Icon, { icon: defaultIcon }),
|
|
27
|
-
title: 'Reset',
|
|
28
|
-
value: 'reset',
|
|
29
|
-
onClick: () => {
|
|
30
|
-
setCurrentOption('reset');
|
|
31
|
-
onPressedChange('reset');
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
];
|
|
35
|
-
return (React.createElement(DropdownMenu, { controls: allOptions, className: classNames('blockbite-ui__dropdown-picker border-primary border', className), icon: ((_a = options.find((option) => option.value === currentOption)) === null || _a === void 0 ? void 0 : _a.icon) || (React.createElement(Icon, { icon: defaultIcon })), label: label || 'Select' }));
|
|
36
|
-
};
|
|
37
|
-
//# sourceMappingURL=DropdownPic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EAAE,WAAW,GAAI;YACjC,KAAK,EAAE,OAAO;YACd,KAAK,EAAE,OAAO;YACd,OAAO,EAAE,GAAG,EAAE;gBACZ,gBAAgB,CAAC,OAAO,CAAC,CAAC;gBAC1B,eAAe,CAAC,OAAO,CAAC,CAAC;YAC3B,CAAC;SACF;KACF,CAAC;IAEF,OAAO,CACL,oBAAC,YAAY,IACX,QAAQ,EAAE,UAAU,EACpB,SAAS,EAAE,UAAU,CACnB,qDAAqD,EACrD,SAAS,CACV,EACD,IAAI,EACF,CAAA,MAAA,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,KAAK,aAAa,CAAC,0CAAE,IAAI,KAAI,CAChE,oBAAC,IAAI,IAAC,IAAI,EAAE,WAAW,GAAI,CAC5B,EAEH,KAAK,EAAE,KAAK,IAAI,QAAQ,GACxB,CACH,CAAC;AACJ,CAAC,CAAC"}
|
package/dist/EmptyState.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import React from 'react';
|
|
13
|
-
void React;
|
|
14
|
-
export function EmptyState(_a) {
|
|
15
|
-
var { icon, title, description, children = null } = _a, rest = __rest(_a, ["icon", "title", "description", "children"]);
|
|
16
|
-
return (React.createElement("div", Object.assign({}, rest),
|
|
17
|
-
React.createElement("div", { className: "flex h-full w-full flex-col items-center justify-center text-center !font-sans" },
|
|
18
|
-
React.createElement("div", { className: "max-w-sm" },
|
|
19
|
-
icon && React.createElement("div", { className: "mx-auto !text-gray-400" }, icon),
|
|
20
|
-
React.createElement("h3", { className: "text-gray-medium mt-2 !font-sans text-sm font-medium" }, title),
|
|
21
|
-
React.createElement("p", { className: "mt-1 !font-sans text-sm !text-gray-500" }, description),
|
|
22
|
-
children && React.createElement("div", { className: "mt-4" }, children)))));
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=EmptyState.js.map
|
package/dist/EmptyState.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyState.js","sourceRoot":"","sources":["../src/EmptyState.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,KAAK,KAAK,CAAC;AASX,MAAM,UAAU,UAAU,CAAC,EAMnB;QANmB,EACzB,IAAI,EACJ,KAAK,EACL,WAAW,EACX,QAAQ,GAAG,IAAI,OAET,EADH,IAAI,cALkB,4CAM1B,CADQ;IAEP,OAAO,CACL,6CAAS,IAAI;QACX,6BAAK,SAAS,EAAC,gFAAgF;YAC7F,6BAAK,SAAS,EAAC,UAAU;gBACtB,IAAI,IAAI,6BAAK,SAAS,EAAC,wBAAwB,IAAE,IAAI,CAAO;gBAC7D,4BAAI,SAAS,EAAC,sDAAsD,IACjE,KAAK,CACH;gBACL,2BAAG,SAAS,EAAC,wCAAwC,IAClD,WAAW,CACV;gBACH,QAAQ,IAAI,6BAAK,SAAS,EAAC,MAAM,IAAE,QAAQ,CAAO,CAC/C,CACF,CACF,CACP,CAAC;AACJ,CAAC"}
|
package/dist/FloatingPanel.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { useEffect, useRef, useState } from '@wordpress/element';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
void React;
|
|
4
|
-
export function FloatingPanel({ children, }) {
|
|
5
|
-
const panelRef = useRef(null);
|
|
6
|
-
const [position, setPosition] = useState({ x: 100, y: 100 });
|
|
7
|
-
const [dragging, setDragging] = useState(false);
|
|
8
|
-
const [offset, setOffset] = useState({ x: 0, y: 0 });
|
|
9
|
-
useEffect(() => {
|
|
10
|
-
const handleMouseMove = (e) => {
|
|
11
|
-
if (dragging) {
|
|
12
|
-
setPosition({
|
|
13
|
-
x: e.clientX - offset.x,
|
|
14
|
-
y: e.clientY - offset.y,
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
const handleMouseUp = () => setDragging(false);
|
|
19
|
-
window.addEventListener('mousemove', handleMouseMove);
|
|
20
|
-
window.addEventListener('mouseup', handleMouseUp);
|
|
21
|
-
return () => {
|
|
22
|
-
window.removeEventListener('mousemove', handleMouseMove);
|
|
23
|
-
window.removeEventListener('mouseup', handleMouseUp);
|
|
24
|
-
};
|
|
25
|
-
}, [dragging, offset]);
|
|
26
|
-
const startDragging = (e) => {
|
|
27
|
-
const rect = panelRef.current.getBoundingClientRect();
|
|
28
|
-
setOffset({ x: e.clientX - rect.left, y: e.clientY - rect.top });
|
|
29
|
-
setDragging(true);
|
|
30
|
-
};
|
|
31
|
-
return (React.createElement("div", { className: "bb_" },
|
|
32
|
-
React.createElement("div", { ref: panelRef, className: "fixed bg-white shadow-xl rounded-2xl p-4 w-[400px] h-[550px] z-[9999]", style: { left: position.x, top: position.y } },
|
|
33
|
-
children,
|
|
34
|
-
React.createElement("div", { className: "absolute top-1 right-1 cursor-move w-5 h-5 bg-gray-300 rounded", onMouseDown: startDragging }))));
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=FloatingPanel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FloatingPanel.js","sourceRoot":"","sources":["../src/FloatingPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,KAAK,MAAM,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C,CAAC,EAAE,EAAE;QAC1B,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAC;QACtD,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;QACjE,WAAW,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC,CAAC;IAEF,OAAO,CACL,6BAAK,SAAS,EAAC,KAAK;QAClB,6BACE,GAAG,EAAE,QAAQ,EACb,SAAS,EAAC,uEAAuE,EACjF,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC,EAAE;YAE3C,QAAQ;YACT,6BACE,SAAS,EAAC,gEAAgE,EAC1E,WAAW,EAAE,aAAa,GACrB,CACH,CACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { FocalPointPicker } from '@wordpress/components';
|
|
2
|
-
import { useEffect, useState } from '@wordpress/element';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { Wrap } from './Wrap.js';
|
|
5
|
-
void React;
|
|
6
|
-
export const FocalPointControl = ({ defaultValue, onValueChange, url, }) => {
|
|
7
|
-
const [focalPoint, setFocalPoint] = useState({
|
|
8
|
-
x: 0.5,
|
|
9
|
-
y: 0.5,
|
|
10
|
-
});
|
|
11
|
-
useEffect(() => {
|
|
12
|
-
onValueChange(`[${(focalPoint.x * 100).toFixed(2)}%_${(focalPoint.y * 100).toFixed(2)}%]`);
|
|
13
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
14
|
-
}, [focalPoint]);
|
|
15
|
-
useEffect(() => {
|
|
16
|
-
// default value is in the format of [x%_y%] parse to get the x and y values
|
|
17
|
-
if (defaultValue.includes('%')) {
|
|
18
|
-
const [x, y] = defaultValue
|
|
19
|
-
.replace('[', '')
|
|
20
|
-
.replace('%]', '')
|
|
21
|
-
.split('_')
|
|
22
|
-
.map((value) => parseFloat(value) / 100);
|
|
23
|
-
setFocalPoint({
|
|
24
|
-
x,
|
|
25
|
-
y,
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
}, [defaultValue]);
|
|
29
|
-
return (React.createElement(Wrap, { className: "relative flex flex-col" },
|
|
30
|
-
React.createElement(FocalPointPicker, { url: url, value: focalPoint, onDrag: (value) => setFocalPoint(value), onChange: (value) => setFocalPoint(value) })));
|
|
31
|
-
};
|
|
32
|
-
export default FocalPointControl;
|
|
33
|
-
//# sourceMappingURL=FocalPointControl.js.map
|