@thebase/ui 1.1.3 → 1.1.5
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/CHANGELOG.md +37 -18
- package/README.md +26 -22
- package/bin/create-baseui-app.mjs +7 -7
- package/dist/baseui.apidoc.esm.js +949 -0
- package/dist/baseui.apidoc.min.js +950 -0
- package/dist/baseui.esm.js +31 -31
- package/dist/baseui.min.css +1 -1
- package/dist/baseui.min.js +31 -31
- package/dist/baseui.registry.json +5 -5
- package/dist/baseui.templates.xml +60 -31
- package/dist/types/apidoc.d.ts +27 -0
- package/docs/analytics.md +5 -5
- package/docs/blocks.md +5 -5
- package/docs/components/accordion.md +3 -3
- package/docs/components/alert-dialog.md +2 -2
- package/docs/components/alert.md +2 -2
- package/docs/components/apidoc.md +17 -4
- package/docs/components/aspect-ratio.md +2 -2
- package/docs/components/attachment.md +3 -3
- package/docs/components/avatar.md +5 -5
- package/docs/components/badge.md +2 -2
- package/docs/components/block-viewer.md +4 -4
- package/docs/components/breadcrumb.md +3 -3
- package/docs/components/bubble.md +2 -2
- package/docs/components/button-group.md +2 -2
- package/docs/components/button.md +2 -2
- package/docs/components/calendar.md +5 -5
- package/docs/components/card.md +2 -2
- package/docs/components/carousel.md +5 -5
- package/docs/components/chart.md +5 -5
- package/docs/components/checkbox.md +2 -2
- package/docs/components/clipboard-button.md +2 -2
- package/docs/components/collapsible.md +2 -2
- package/docs/components/combobox.md +7 -6
- package/docs/components/command.md +5 -5
- package/docs/components/context-menu.md +5 -5
- package/docs/components/data-table.md +6 -6
- package/docs/components/date-picker.md +9 -8
- package/docs/components/dialog.md +4 -4
- package/docs/components/direction.md +2 -2
- package/docs/components/drawer.md +3 -3
- package/docs/components/dropdown-menu.md +3 -3
- package/docs/components/empty.md +3 -3
- package/docs/components/field.md +23 -17
- package/docs/components/form.md +3 -3
- package/docs/components/hover-card.md +5 -8
- package/docs/components/icon.md +3 -3
- package/docs/components/input-group.md +8 -7
- package/docs/components/input-otp.md +5 -5
- package/docs/components/input.md +6 -5
- package/docs/components/item.md +2 -2
- package/docs/components/kbd.md +2 -2
- package/docs/components/label.md +2 -2
- package/docs/components/markdown.md +3 -3
- package/docs/components/marker.md +2 -2
- package/docs/components/menubar.md +2 -2
- package/docs/components/message-scroller.md +5 -5
- package/docs/components/message.md +5 -5
- package/docs/components/native-select.md +4 -4
- package/docs/components/navigation-menu.md +3 -3
- package/docs/components/pagination.md +3 -3
- package/docs/components/popover.md +7 -7
- package/docs/components/progress.md +2 -2
- package/docs/components/pwa.md +2 -2
- package/docs/components/questionnaire.md +5 -5
- package/docs/components/radio-group.md +2 -2
- package/docs/components/resizable.md +5 -5
- package/docs/components/scroll-area.md +5 -5
- package/docs/components/select.md +6 -5
- package/docs/components/separator.md +2 -2
- package/docs/components/sheet.md +3 -3
- package/docs/components/shell.md +2 -2
- package/docs/components/sidebar.md +2 -2
- package/docs/components/skeleton.md +2 -2
- package/docs/components/slider.md +2 -2
- package/docs/components/spinner.md +3 -3
- package/docs/components/switch.md +2 -2
- package/docs/components/table.md +2 -2
- package/docs/components/tabs.md +4 -4
- package/docs/components/text-editor.md +2 -2
- package/docs/components/textarea.md +11 -15
- package/docs/components/theme-button.md +4 -4
- package/docs/components/toast.md +3 -3
- package/docs/components/toggle-group.md +5 -5
- package/docs/components/toggle.md +5 -5
- package/docs/components/tooltip.md +7 -7
- package/docs/components/typography.md +3 -3
- package/docs/icons.md +7 -7
- package/docs/installation.md +14 -13
- package/docs/owl-components.md +17 -17
- package/docs/registry.md +8 -8
- package/docs/runtime-api.md +3 -3
- package/docs/theming.md +5 -5
- package/docs/usage-guide.md +26 -26
- package/package.json +9 -2
|
@@ -1697,13 +1697,13 @@
|
|
|
1697
1697
|
}
|
|
1698
1698
|
],
|
|
1699
1699
|
"integrity": {
|
|
1700
|
-
"baseui.min.css": "sha384-
|
|
1700
|
+
"baseui.min.css": "sha384-MzYm4tnpt85MomNRXCdL9Rs4jDdw2qAPIoagZbC8/1kQLnPbHlW2tIf2F9OmRgPj",
|
|
1701
1701
|
"bootstrap.bundle.min.js": "sha384-RMbllTJcplkCRnELNTOc5Kz/3AvFDE/rNlJqWqfgmRWruobClBdfwvl10akQZkR1",
|
|
1702
|
-
"baseui.min.js": "sha384-
|
|
1703
|
-
"baseui.esm.js": "sha384-
|
|
1702
|
+
"baseui.min.js": "sha384-GcCWnFI6t+f/dc757+Crav6N80AmqwuB2K8kSTaeb08ErsYd9mTHA1aKB/rnQltB",
|
|
1703
|
+
"baseui.esm.js": "sha384-UBVYm8E0mq0ZAVhefx5fmnAJVT31BD4cukBRhCyGIqxJ8AtoRNqg92NJ6uC233zU",
|
|
1704
1704
|
"baseui.icons.esm.js": "sha384-hj39VMhzcFvmYnjob2hlioMOAqwAXCURGreF6s9RitXFp/iYi7rUdqtfCI+ICQeS",
|
|
1705
|
-
"baseui.templates.xml": "sha384-
|
|
1706
|
-
"baseui.block-viewer.esm.js": "sha384-
|
|
1705
|
+
"baseui.templates.xml": "sha384-9llWP0L4BuRpij3wEYymvwY8MOBd11X9mdXqI2JtYHr9j2tCrTbE0hIEMNCDOFdj",
|
|
1706
|
+
"baseui.block-viewer.esm.js": "sha384-5Y2lUNdq6p3i8srVH4rVWtYLO7mFPP6Pqn80e4Ih32c/PgQqy1HDf6nI04mu6yLa",
|
|
1707
1707
|
"baseui.analytics.esm.js": "sha384-M6TVmchmceTvpSzgI+DNA6zAn9xmz9a+YEexCLslSo/Ngxyp2kmzs9fm+PxWy+Da",
|
|
1708
1708
|
"baseui.analytics.min.js": "sha384-B0hBkVDbT7gmDmUMazlN4Nc1KnYGSpL+IcW2hd8840knx73HGImPgGs84MvS3hKE",
|
|
1709
1709
|
"icons/lucide.json": "sha384-mc5mzpmq9eOgZVa2IcjrL33Ty4nMXE8aoZMfy+lgkC/jMQ4aYnk2S58mFsSGFnW1",
|
|
@@ -731,7 +731,7 @@
|
|
|
731
731
|
<section t-att-class="state.mode === 'code' ? 'bu-block-code-panel is-active' : 'bu-block-code-panel'">
|
|
732
732
|
<div class="bu-block-code-toolbar" role="group" aria-label="Code source">
|
|
733
733
|
<Button variant="'ghost'" type="'button'" ariaPressed="state.codeVariant === 'owl' ? 'true' : 'false'" onClick="() => this.setCodeVariant('owl')">
|
|
734
|
-
|
|
734
|
+
Base Component
|
|
735
735
|
</Button>
|
|
736
736
|
<Button variant="'ghost'" type="'button'" ariaPressed="state.codeVariant === 'template' ? 'true' : 'false'" onClick="() => this.setCodeVariant('template')">
|
|
737
737
|
Template
|
|
@@ -1085,16 +1085,7 @@
|
|
|
1085
1085
|
</t>
|
|
1086
1086
|
<t t-name="baseui.Combobox">
|
|
1087
1087
|
<div t-att-class="'bu-combobox' + (props.className ? ' ' + props.className : '')" t-att-style="props.style" t-ref="root">
|
|
1088
|
-
<
|
|
1089
|
-
class="form-control"
|
|
1090
|
-
role="combobox"
|
|
1091
|
-
t-att-id="props.id"
|
|
1092
|
-
t-att-aria-expanded="disclosure.open ? 'true' : 'false'"
|
|
1093
|
-
t-att-placeholder="props.placeholder"
|
|
1094
|
-
t-att-value="state.query"
|
|
1095
|
-
t-on-input="onInput"
|
|
1096
|
-
t-on-focus="onFocus"
|
|
1097
|
-
/>
|
|
1088
|
+
<t t-call="baseui.Outlined"><t t-call="baseui.Combobox.field"/></t>
|
|
1098
1089
|
<div t-if="disclosure.open" class="bu-combobox-list" role="listbox">
|
|
1099
1090
|
<div
|
|
1100
1091
|
t-foreach="filteredOptions"
|
|
@@ -1109,6 +1100,21 @@
|
|
|
1109
1100
|
</div>
|
|
1110
1101
|
</div>
|
|
1111
1102
|
</t>
|
|
1103
|
+
<t t-name="baseui.Combobox.field">
|
|
1104
|
+
<input
|
|
1105
|
+
t-att-class="classNames"
|
|
1106
|
+
role="combobox"
|
|
1107
|
+
t-att-id="props.id"
|
|
1108
|
+
t-att-disabled="props.disabled"
|
|
1109
|
+
t-att-aria-expanded="disclosure.open ? 'true' : 'false'"
|
|
1110
|
+
t-att-aria-invalid="isInvalid ? 'true' : undefined"
|
|
1111
|
+
t-att-aria-describedby="describedBy"
|
|
1112
|
+
t-att-placeholder="fieldPlaceholder"
|
|
1113
|
+
t-att-value="state.query"
|
|
1114
|
+
t-on-input="onInput"
|
|
1115
|
+
t-on-focus="onFocus"
|
|
1116
|
+
/>
|
|
1117
|
+
</t>
|
|
1112
1118
|
<t t-name="Combobox" t-call="baseui.Combobox"/>
|
|
1113
1119
|
<t t-name="baseui.command">
|
|
1114
1120
|
<div b-ui="command" class="bu-command"/>
|
|
@@ -1344,12 +1350,17 @@
|
|
|
1344
1350
|
<input class="form-control" type="date"/>
|
|
1345
1351
|
</t>
|
|
1346
1352
|
<t t-name="baseui.DatePicker">
|
|
1353
|
+
<t t-call="baseui.Outlined"><t t-call="baseui.DatePicker.field"/></t>
|
|
1354
|
+
</t>
|
|
1355
|
+
<t t-name="baseui.DatePicker.field">
|
|
1347
1356
|
<input
|
|
1348
1357
|
type="date"
|
|
1349
1358
|
t-att-class="classNames"
|
|
1350
1359
|
t-att-style="props.style"
|
|
1351
1360
|
t-att-value="props.value"
|
|
1352
1361
|
t-att-disabled="props.disabled"
|
|
1362
|
+
t-att-aria-invalid="isInvalid ? 'true' : undefined"
|
|
1363
|
+
t-att-aria-describedby="describedBy"
|
|
1353
1364
|
t-on-input="onInput"
|
|
1354
1365
|
/>
|
|
1355
1366
|
</t>
|
|
@@ -1616,13 +1627,7 @@
|
|
|
1616
1627
|
t-att-class="classNames"
|
|
1617
1628
|
t-att-style="props.style"
|
|
1618
1629
|
>
|
|
1619
|
-
<label t-if="props.label" class="bu-field-label" data-slot="field-label">
|
|
1620
|
-
<t t-esc="props.label"/>
|
|
1621
|
-
</label>
|
|
1622
1630
|
<t t-slot="default"/>
|
|
1623
|
-
<div t-if="props.error" role="alert" class="bu-field-error" data-slot="field-error">
|
|
1624
|
-
<t t-esc="props.error"/>
|
|
1625
|
-
</div>
|
|
1626
1631
|
</div>
|
|
1627
1632
|
</t>
|
|
1628
1633
|
<t t-name="Field" t-call="baseui.Field"/>
|
|
@@ -1746,7 +1751,7 @@
|
|
|
1746
1751
|
</t>
|
|
1747
1752
|
<t t-name="HoverCardTrigger" t-call="baseui.HoverCardTrigger"/>
|
|
1748
1753
|
<t t-name="baseui.HoverCardContent">
|
|
1749
|
-
<span t-if="open" class="bu-hover-card-content" t-att-style="props.style" role="dialog"><t t-slot="default"/></span>
|
|
1754
|
+
<span t-if="open" t-att-class="'bu-hover-card-content' + (props.className ? ' ' + props.className : '')" t-att-style="props.style" role="dialog"><t t-slot="default"/></span>
|
|
1750
1755
|
</t>
|
|
1751
1756
|
<t t-name="HoverCardContent" t-call="baseui.HoverCardContent"/>
|
|
1752
1757
|
<t t-name="baseui.Icon">
|
|
@@ -1761,12 +1766,12 @@
|
|
|
1761
1766
|
></span>
|
|
1762
1767
|
</t>
|
|
1763
1768
|
<t t-name="Icon" t-call="baseui.Icon"/>
|
|
1764
|
-
<t t-name="baseui.
|
|
1765
|
-
<div t-if="isOutlined" t-att-class="outlinedClassNames">
|
|
1769
|
+
<t t-name="baseui.Outlined">
|
|
1770
|
+
<div t-if="isOutlined" t-att-class="outlinedClassNames" t-att-style="labelStyle">
|
|
1766
1771
|
<div class="bu-input-box">
|
|
1767
|
-
<Icon t-if="
|
|
1768
|
-
<t t-
|
|
1769
|
-
<span class="bu-input-label" t-esc="
|
|
1772
|
+
<Icon t-if="leadingIcon" name="leadingIcon" className="'bu-input-icon bu-input-leading'"/>
|
|
1773
|
+
<t t-out="0"/>
|
|
1774
|
+
<span class="bu-input-label" t-esc="label"/>
|
|
1770
1775
|
<Icon t-if="trailingIcon" name="trailingIcon" className="'bu-input-icon bu-input-trailing'"/>
|
|
1771
1776
|
</div>
|
|
1772
1777
|
<div t-if="supportingText or props.maxLength" class="bu-input-support">
|
|
@@ -1774,7 +1779,10 @@
|
|
|
1774
1779
|
<span t-if="props.maxLength" class="bu-input-counter" t-esc="counter"/>
|
|
1775
1780
|
</div>
|
|
1776
1781
|
</div>
|
|
1777
|
-
<t t-else="" t-
|
|
1782
|
+
<t t-else="" t-out="0"/>
|
|
1783
|
+
</t>
|
|
1784
|
+
<t t-name="baseui.Input">
|
|
1785
|
+
<t t-call="baseui.Outlined"><t t-call="baseui.Input.field"/></t>
|
|
1778
1786
|
</t>
|
|
1779
1787
|
<t t-name="baseui.Input.field">
|
|
1780
1788
|
<input
|
|
@@ -1791,7 +1799,7 @@
|
|
|
1791
1799
|
t-att-maxlength="props.maxLength"
|
|
1792
1800
|
t-att-aria-label="ariaLabel"
|
|
1793
1801
|
t-att-aria-invalid="isInvalid ? 'true' : undefined"
|
|
1794
|
-
t-att-aria-describedby="
|
|
1802
|
+
t-att-aria-describedby="describedBy"
|
|
1795
1803
|
t-att-min="props.min"
|
|
1796
1804
|
t-att-max="props.max"
|
|
1797
1805
|
t-att-step="props.step"
|
|
@@ -1802,7 +1810,11 @@
|
|
|
1802
1810
|
<t t-name="Input" t-call="baseui.Input"/>
|
|
1803
1811
|
<t t-name="baseui.input-group"><div b-ui="input-group"><t t-esc="props.content"/></div></t>
|
|
1804
1812
|
<t t-name="baseui.InputGroup">
|
|
1805
|
-
<
|
|
1813
|
+
<t t-call="baseui.Outlined"><t t-call="baseui.InputGroup.box"/></t>
|
|
1814
|
+
</t>
|
|
1815
|
+
<t t-name="baseui.InputGroup.box">
|
|
1816
|
+
<div t-att-class="classNames" t-att-style="props.style" data-slot="input-group" role="group"
|
|
1817
|
+
t-att-aria-describedby="describedBy"><t t-slot="default"/></div>
|
|
1806
1818
|
</t>
|
|
1807
1819
|
<t t-name="baseui.InputGroupAddon">
|
|
1808
1820
|
<div
|
|
@@ -1837,7 +1849,7 @@
|
|
|
1837
1849
|
t-att-class="classNames"
|
|
1838
1850
|
t-att-style="props.style"
|
|
1839
1851
|
t-att-type="props.type || 'text'"
|
|
1840
|
-
t-att-placeholder="
|
|
1852
|
+
t-att-placeholder="fieldPlaceholder"
|
|
1841
1853
|
t-att-value="props.value"
|
|
1842
1854
|
t-att-disabled="props.disabled"
|
|
1843
1855
|
t-att-readonly="props.readonly"
|
|
@@ -1851,7 +1863,7 @@
|
|
|
1851
1863
|
<textarea
|
|
1852
1864
|
t-att-class="classNames"
|
|
1853
1865
|
t-att-style="props.style"
|
|
1854
|
-
t-att-placeholder="
|
|
1866
|
+
t-att-placeholder="fieldPlaceholder"
|
|
1855
1867
|
t-att-rows="props.rows"
|
|
1856
1868
|
t-att-disabled="props.disabled"
|
|
1857
1869
|
t-att-readonly="props.readonly"
|
|
@@ -2044,8 +2056,13 @@
|
|
|
2044
2056
|
<select b-ui="native-select"><t t-slot="default"/></select>
|
|
2045
2057
|
</t>
|
|
2046
2058
|
<t t-name="baseui.NativeSelect">
|
|
2059
|
+
<t t-call="baseui.Outlined"><t t-call="baseui.NativeSelect.field"/></t>
|
|
2060
|
+
</t>
|
|
2061
|
+
<t t-name="baseui.NativeSelect.field">
|
|
2047
2062
|
<select t-att-class="classNames" t-att-disabled="props.disabled" t-att-value="props.value"
|
|
2048
|
-
t-att-aria-label="ariaLabel" t-att-id="props.id" t-att-style="props.style"
|
|
2063
|
+
t-att-aria-label="ariaLabel" t-att-id="props.id" t-att-style="props.style"
|
|
2064
|
+
t-att-aria-invalid="isInvalid ? 'true' : undefined" t-att-aria-describedby="describedBy"
|
|
2065
|
+
t-on-change="onChange">
|
|
2049
2066
|
<t t-slot="default"/>
|
|
2050
2067
|
</select>
|
|
2051
2068
|
</t>
|
|
@@ -2256,7 +2273,13 @@
|
|
|
2256
2273
|
<t t-name="Separator" t-call="baseui.Separator"/>
|
|
2257
2274
|
<t t-name="baseui.select"><div b-ui="select"><t t-esc="props.content"/></div></t>
|
|
2258
2275
|
<t t-name="baseui.Select">
|
|
2259
|
-
<div t-att-class="classNames" t-att-style="
|
|
2276
|
+
<div t-att-class="classNames" t-att-style="rootStyle" t-ref="root">
|
|
2277
|
+
<t t-slot="default"/>
|
|
2278
|
+
<span t-if="isOutlined" class="bu-input-label" t-esc="label"/>
|
|
2279
|
+
<div t-if="isOutlined and supportingText" class="bu-input-support">
|
|
2280
|
+
<span t-att-id="supportId" t-esc="supportingText"/>
|
|
2281
|
+
</div>
|
|
2282
|
+
</div>
|
|
2260
2283
|
</t>
|
|
2261
2284
|
<t t-name="Select" t-call="baseui.Select"/>
|
|
2262
2285
|
<t t-name="baseui.SelectTrigger">
|
|
@@ -2732,15 +2755,21 @@
|
|
|
2732
2755
|
<textarea b-ui="textarea"></textarea>
|
|
2733
2756
|
</t>
|
|
2734
2757
|
<t t-name="baseui.Textarea">
|
|
2758
|
+
<t t-call="baseui.Outlined"><t t-call="baseui.Textarea.field"/></t>
|
|
2759
|
+
</t>
|
|
2760
|
+
<t t-name="baseui.Textarea.field">
|
|
2735
2761
|
<textarea
|
|
2736
2762
|
t-att-class="classNames"
|
|
2737
2763
|
t-att-style="props.style"
|
|
2738
|
-
t-att-placeholder="
|
|
2764
|
+
t-att-placeholder="fieldPlaceholder"
|
|
2739
2765
|
t-att-rows="props.rows"
|
|
2740
2766
|
t-att-disabled="props.disabled"
|
|
2741
2767
|
t-att-readonly="props.readonly"
|
|
2742
2768
|
t-att-value="props.value"
|
|
2743
2769
|
t-att-id="props.id"
|
|
2770
|
+
t-att-maxlength="props.maxLength"
|
|
2771
|
+
t-att-aria-invalid="isInvalid ? 'true' : undefined"
|
|
2772
|
+
t-att-aria-describedby="describedBy"
|
|
2744
2773
|
t-on-input="onInput"
|
|
2745
2774
|
t-on-change="onChange"
|
|
2746
2775
|
></textarea>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** Standalone ApiDoc: renders an OpenAPI 3.x document. Load dist/baseui.min.css for styling. */
|
|
2
|
+
export interface ApiDocProps {
|
|
3
|
+
src?: string;
|
|
4
|
+
spec?: object;
|
|
5
|
+
title?: string;
|
|
6
|
+
serverUrl?: string;
|
|
7
|
+
theme?: "light" | "dark" | "auto";
|
|
8
|
+
themeToggle?: boolean;
|
|
9
|
+
hash?: boolean;
|
|
10
|
+
operation?: string;
|
|
11
|
+
tryIt?: boolean;
|
|
12
|
+
authorize?: boolean;
|
|
13
|
+
languages?: string[];
|
|
14
|
+
language?: string;
|
|
15
|
+
assetBase?: string;
|
|
16
|
+
oauthRedirectUri?: string;
|
|
17
|
+
height?: string;
|
|
18
|
+
className?: string;
|
|
19
|
+
style?: string | Record<string, string>;
|
|
20
|
+
onLoad?(doc: unknown): void;
|
|
21
|
+
onError?(error: unknown): void;
|
|
22
|
+
onNavigate?(id: string): void;
|
|
23
|
+
}
|
|
24
|
+
export interface ApiDocApp { destroy(): void }
|
|
25
|
+
export const ApiDoc: unknown;
|
|
26
|
+
/** Mounts ApiDoc into an element (or selector) and returns the application. */
|
|
27
|
+
export function mountApiDoc(target: Element | string, props?: ApiDocProps): Promise<ApiDocApp> | ApiDocApp;
|
package/docs/analytics.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Analytics
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The Base UI ships a cookieless web-analytics service, ported from [`@plausible-analytics/tracker`](https://www.npmjs.com/package/@plausible-analytics/tracker) 0.4.6 (MIT; notice in `LICENSE`). Nothing is collected until the page calls `init({ backendUrl })`. Available from `@thebase/ui` 1.1.0.
|
|
4
4
|
|
|
5
|
-
It is an optional, standalone feature: it is **not** part of `dist/baseui.min.js`/`dist/baseui.esm.js`, and it needs neither of them (no Owl, Bootstrap or component runtime). Load it on its own, with or without the rest of
|
|
5
|
+
It is an optional, standalone feature: it is **not** part of `dist/baseui.min.js`/`dist/baseui.esm.js`, and it needs neither of them (no Owl, Bootstrap or component runtime). Load it on its own, with or without the rest of the Base UI (~5.6 KB minified):
|
|
6
6
|
|
|
7
7
|
```js
|
|
8
8
|
// npm / bundler
|
|
@@ -13,12 +13,12 @@ init({ backendUrl: "https://stats.example.com" });
|
|
|
13
13
|
```html
|
|
14
14
|
<!-- ES module from the CDN (or map it as "@base/analytics" in an import map) -->
|
|
15
15
|
<script type="module">
|
|
16
|
-
import { init } from "https://cdn.jsdelivr.net/npm/@thebase/ui@1.1.
|
|
16
|
+
import { init } from "https://cdn.jsdelivr.net/npm/@thebase/ui@1.1.5/dist/baseui.analytics.esm.js";
|
|
17
17
|
init({ backendUrl: "https://stats.example.com" });
|
|
18
18
|
</script>
|
|
19
19
|
|
|
20
20
|
<!-- Classic script tag: sets window.thebase.analytics (load order vs dist/baseui.min.js doesn't matter) -->
|
|
21
|
-
<script src="https://cdn.jsdelivr.net/npm/@thebase/ui@1.1.
|
|
21
|
+
<script src="https://cdn.jsdelivr.net/npm/@thebase/ui@1.1.5/dist/baseui.analytics.min.js"></script>
|
|
22
22
|
<script>
|
|
23
23
|
thebase.analytics.init({ backendUrl: "https://stats.example.com" });
|
|
24
24
|
</script>
|
|
@@ -228,7 +228,7 @@ curl -i -X POST http://localhost:8080/api/event -H 'Content-Type: text/plain' \
|
|
|
228
228
|
|
|
229
229
|
[`examples/analytics/`](../examples/analytics/dashboard/?backend=http://localhost:8080) contains a working dashboard plus two complete sample backends: [`server-go`](../examples/analytics/server-go/main.go) (Fiber v3) and [`server-fastapi`](../examples/analytics/server-fastapi/main.py). Each one extends the receivers above with an in-memory store, a daily-salted cookieless visitor hash, a `GET /api/stats` endpoint, and static hosting for the dashboard.
|
|
230
230
|
|
|
231
|
-
The dashboard ([`dashboard/`](../examples/analytics/dashboard/?backend=http://localhost:8080)) is a pure
|
|
231
|
+
The dashboard ([`dashboard/`](../examples/analytics/dashboard/?backend=http://localhost:8080)) is a pure application that loads `@thebase/ui@1.1.5` from jsDelivr: KPI `Card`s, an area `Chart`, top pages/sources/events `Table`s, site and period `NativeSelect`s, and a `ThemeButton`. It refreshes every 30 s and tracks its own visits through `@thebase/ui/analytics`, so a fresh backend has data straight away.
|
|
232
232
|
|
|
233
233
|
```sh
|
|
234
234
|
# Go (1.25+)
|
package/docs/blocks.md
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
# Blocks
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The Base UI blocks are static HTML compositions styled by the same shadcn-aligned tokens as the component library. They are based on the public shadcn/ui blocks page and keep the same sizing landmarks: `min-height: 100svh`, sidebar widths, header heights, `gap-4`/`gap-6`, muted backgrounds, and auth-card widths.
|
|
4
4
|
|
|
5
5
|
Each block has its own source stylesheet in `examples/blocks/<block-name>.css`. Shared helpers live in `examples/blocks/shared.css`; new blocks should not be folded into an all-in-one block stylesheet.
|
|
6
6
|
|
|
7
|
-
Block navigation icons must use
|
|
7
|
+
Block navigation icons must use the Base UI's built-in Lucide icon component, for example `<span b-icon="layout-dashboard" b-block-icon></span>`. Do not use placeholder letters inside `b-block-icon`.
|
|
8
8
|
|
|
9
|
-
Blocks are not standalone runtime components. Paste the markup and load the normal
|
|
9
|
+
Blocks are not standalone runtime components. Paste the markup and load the normal the Base UI assets:
|
|
10
10
|
|
|
11
11
|
```html
|
|
12
12
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@thebase/ui@latest/dist/baseui.min.css">
|
|
13
13
|
<script src="https://cdn.jsdelivr.net/npm/@thebase/ui@latest/dist/baseui.min.js" defer></script>
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
`https://unpkg.com/@thebase/ui@latest/dist/...` mirrors the same files as an alternative CDN if jsDelivr is unreachable. Pin an exact version (e.g. `@1.1.
|
|
16
|
+
`https://unpkg.com/@thebase/ui@latest/dist/...` mirrors the same files as an alternative CDN if jsDelivr is unreachable. Pin an exact version (e.g. `@1.1.5`, or `@1` to take only non-breaking updates) instead of `@latest` for production. Blocks are static markup, so they only need the static `b-ui` runtime above — see [Usage Guide](usage-guide.md) if the surrounding page is itself an application and you'd rather compose the equivalent layout from [Base Components](owl-components.md).
|
|
17
17
|
|
|
18
18
|
Use `b-block` to select the block style:
|
|
19
19
|
|
|
@@ -30,7 +30,7 @@ The docs/dev server serves the block gallery at `/blocks` through the shared `ex
|
|
|
30
30
|
|
|
31
31
|
## Included Blocks
|
|
32
32
|
|
|
33
|
-
- `apidoc-01`: full-page API reference built from an OpenAPI 3 file with the pure
|
|
33
|
+
- `apidoc-01`: full-page API reference built from an OpenAPI 3 file with the pure Base `ApiDoc` component (sidebar, schemas, Try It, Authorize); see [ApiDoc](components/apidoc.md).
|
|
34
34
|
- `chart-01`: copyable usage block showing how to compose `b-ui="chart"` with chart slots, SVG primitives, tokens, and footer copy.
|
|
35
35
|
- `dashboard-01`: dashboard shell with inset sidebar, header, metric cards, chart surface, and table area.
|
|
36
36
|
- `sidebar-01` through `sidebar-16`: static conversions of the current shadcn/ui sidebar block family, including documentation sidebars, collapsible groups, inset navigation, mail, workspace, file explorer, calendar, dialog, right TOC, dual-sidebar, and sticky-header variants.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Use `b-ui="accordion"` for grouped disclosure panels.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Base component
|
|
6
6
|
|
|
7
7
|
```js
|
|
8
8
|
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "@thebase/ui";
|
|
@@ -37,7 +37,7 @@ import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "@t
|
|
|
37
37
|
| `AccordionItem` | `className` | `String` | optional |
|
|
38
38
|
| `AccordionTrigger` | `className` | `String` | optional |
|
|
39
39
|
|
|
40
|
-
See [
|
|
40
|
+
See [Base Components](/examples/blocks.html#/docs/guide/owl-components) for how to load `@base/owl` and `dist/baseui.templates.xml`.
|
|
41
41
|
|
|
42
42
|
## Static component
|
|
43
43
|
|
|
@@ -67,6 +67,6 @@ See [Pure Owl Components](/examples/blocks.html#/docs/guide/owl-components) for
|
|
|
67
67
|
</div>
|
|
68
68
|
```
|
|
69
69
|
|
|
70
|
-
Options: `b-att-multiple="true"` allows more than one item to stay open. Events: `baseui:change`. Keyboard: buttons use native activation and focus behavior. The static adapter only wires ARIA/toggle behavior onto author-provided markup — add your own trailing chevron icon (`b-icon="chevron-down" class="bu-accordion-trigger-icon"`) inside the trigger for the rotating-chevron look the pure
|
|
70
|
+
Options: `b-att-multiple="true"` allows more than one item to stay open. Events: `baseui:change`. Keyboard: buttons use native activation and focus behavior. The static adapter only wires ARIA/toggle behavior onto author-provided markup — add your own trailing chevron icon (`b-icon="chevron-down" class="bu-accordion-trigger-icon"`) inside the trigger for the rotating-chevron look the pure Base `AccordionTrigger` renders automatically, and set `b-att-state="open"` on an item to have it expanded by default.
|
|
71
71
|
|
|
72
72
|
Each panel (`b-accordion-panel` / `AccordionContent`'s root) is driven by its own live `bootstrap.Collapse` instance: it always carries the Bootstrap `collapse` class (plus `show` while open), and Bootstrap itself manages the `collapsing`/height transition and the `show` class across toggles — don't rely on `hidden`/node removal to detect open state. In single-open mode (the default, without `multiple`), opening one item hides every other open item's own `bootstrap.Collapse` instance before showing the clicked item's.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Alert Dialog
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Base component
|
|
4
4
|
|
|
5
5
|
```js
|
|
6
6
|
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogTitle, AlertDialogTrigger, Icon } from "@thebase/ui";
|
|
@@ -41,7 +41,7 @@ import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent,
|
|
|
41
41
|
| `AlertDialogTitle` | `className` | `String` | optional |
|
|
42
42
|
| `AlertDialogTrigger` | `className` | `String` | optional |
|
|
43
43
|
|
|
44
|
-
See [
|
|
44
|
+
See [Base Components](/examples/blocks.html#/docs/guide/owl-components) for how to load `@base/owl` and `dist/baseui.templates.xml`.
|
|
45
45
|
|
|
46
46
|
## Static component
|
|
47
47
|
|
package/docs/components/alert.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Alert
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Base component
|
|
4
4
|
|
|
5
5
|
```js
|
|
6
6
|
import { Alert, AlertAction, AlertDescription, AlertTitle, Button, Icon } from "@thebase/ui";
|
|
@@ -30,7 +30,7 @@ import { Alert, AlertAction, AlertDescription, AlertTitle, Button, Icon } from "
|
|
|
30
30
|
| `AlertDescription` | `className` | `String` | optional |
|
|
31
31
|
| `AlertAction` | `className` | `String` | optional |
|
|
32
32
|
|
|
33
|
-
See [
|
|
33
|
+
See [Base Components](/examples/blocks.html#/docs/guide/owl-components) for how to load `@base/owl` and `dist/baseui.templates.xml`.
|
|
34
34
|
|
|
35
35
|
## Static component
|
|
36
36
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# ApiDoc
|
|
2
2
|
|
|
3
|
-
Use `b-ui="apidoc"` (or the pure
|
|
3
|
+
Use `b-ui="apidoc"` (or the pure Base `ApiDoc` component) to render an **OpenAPI 3.0+ JSON** document as browsable API documentation: a grouped sidebar, per-operation parameters / request body / responses / callbacks, a **Try It** panel with request code samples in 17 languages, and an **Authorize** dialog (API key, HTTP basic, bearer, OpenID Connect token, OAuth2 implicit / authorization-code / password / client-credentials).
|
|
4
4
|
|
|
5
5
|
Swagger 2.0 documents still render, but OpenAPI 3.x is the supported input: `requestBody`, `components.securitySchemes` (`http`, `apiKey`, `oauth2` `flows`, `openIdConnect`, `mutualTLS`), `servers` with variables, `webhooks`, `callbacks`, `links`, tag `parent`/`kind`, and `$ref` to components are all understood.
|
|
6
6
|
|
|
7
7
|
Markdown in `info.description`, tag and operation descriptions is rendered with the [Markdown](markdown.md) component (fenced ` ```mermaid ` blocks become diagrams). The spec is trusted content — descriptions are rendered as Markdown/HTML, so do not point ApiDoc at a spec you do not control.
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## Base component
|
|
10
10
|
|
|
11
11
|
```js
|
|
12
12
|
import { ApiDoc } from "@base/component";
|
|
@@ -22,13 +22,26 @@ Pass an already-parsed document with `spec` instead of `src`:
|
|
|
22
22
|
<ApiDoc spec="state.spec" serverUrl="'https://api.example.com'" tryIt="false"/>
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
+
## Standalone (`@thebase/ui/apidoc`)
|
|
26
|
+
|
|
27
|
+
Like the analytics service, ApiDoc also ships as its own bundle that needs neither the full the Base UI script nor a templates file (Owl and ApiDoc's templates are embedded). Load `baseui.min.css` for styling.
|
|
28
|
+
|
|
29
|
+
```js
|
|
30
|
+
import { mountApiDoc } from "@thebase/ui/apidoc";
|
|
31
|
+
|
|
32
|
+
const app = await mountApiDoc("#docs", { src: "/openapi.json", hash: true, assetBase: "/node_modules/@thebase/ui/dist/apidoc" });
|
|
33
|
+
// app.destroy() removes it
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
`mountApiDoc(target, props)` takes an element or selector plus the props below. Without a bundler, import `dist/baseui.apidoc.esm.js` from a CDN, or load `dist/baseui.apidoc.min.js`, which sets `window.thebase.apidoc.mountApiDoc`.
|
|
37
|
+
|
|
25
38
|
## Static component
|
|
26
39
|
|
|
27
40
|
```html
|
|
28
41
|
<div b-ui="apidoc" b-att-src="/openapi.json" b-att-height="100vh" b-att-hash="true"></div>
|
|
29
42
|
```
|
|
30
43
|
|
|
31
|
-
The static adapter fetches `baseui.templates.xml` from the folder the
|
|
44
|
+
The static adapter fetches `baseui.templates.xml` from the folder the Base UI script was loaded from; set `b-att-templates` to override.
|
|
32
45
|
|
|
33
46
|
## Props / attributes
|
|
34
47
|
|
|
@@ -46,7 +59,7 @@ The static adapter fetches `baseui.templates.xml` from the folder the BaseUI scr
|
|
|
46
59
|
| `authorize` | `b-att-authorize` | `true` | Show the Authorize button when the spec defines security schemes. |
|
|
47
60
|
| `languages` | `b-att-languages` | all 17 | Which code-sample languages to offer, e.g. `['curl', 'node', 'python']` / `curl,node,python`. |
|
|
48
61
|
| `language` | `b-att-language` | `curl` | Language selected first. |
|
|
49
|
-
| `assetBase` | `b-att-asset-base` | `dist/apidoc` beside the
|
|
62
|
+
| `assetBase` | `b-att-asset-base` | `dist/apidoc` beside the Base UI script | Folder that holds `img/*.svg` language logos. Empty string hides the logos. |
|
|
50
63
|
| `oauthRedirectUri` | `b-att-oauth-redirect-uri` | `oauth2-redirect.html` next to the page | Popup landing page for the implicit / authorization-code flows (see `src/components/apidoc/oauth2-redirect.html`). |
|
|
51
64
|
| `height` | `b-att-height` | `100vh` | CSS height of the component. |
|
|
52
65
|
| `className`, `style` | — | — | Standard root class / inline style. |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Aspect Ratio
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Base component
|
|
4
4
|
|
|
5
5
|
```js
|
|
6
6
|
import { AspectRatio } from "@thebase/ui";
|
|
@@ -21,7 +21,7 @@ import { AspectRatio } from "@thebase/ui";
|
|
|
21
21
|
| `AspectRatio` | `height` | `Number` | optional |
|
|
22
22
|
| `AspectRatio` | `className` | `String` | optional |
|
|
23
23
|
|
|
24
|
-
See [
|
|
24
|
+
See [Base Components](/examples/blocks.html#/docs/guide/owl-components) for how to load `@base/owl` and `dist/baseui.templates.xml`.
|
|
25
25
|
|
|
26
26
|
## Static component
|
|
27
27
|
|
|
@@ -4,9 +4,9 @@ Use `b-ui="attachment"` for a CDN-ready attachment card with media, metadata, up
|
|
|
4
4
|
|
|
5
5
|
## CDN install requirements
|
|
6
6
|
|
|
7
|
-
Load the pinned
|
|
7
|
+
Load the pinned the Base UI CSS and JavaScript files; no extra dependency is required for this component.
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## Base component
|
|
10
10
|
|
|
11
11
|
```js
|
|
12
12
|
import {
|
|
@@ -121,7 +121,7 @@ import {
|
|
|
121
121
|
| `AttachmentDropzone` | `disabled` | `Boolean` | disables click/drag/drop |
|
|
122
122
|
| `AttachmentDropzone` | `onFilesSelected` | `Function` | receives the picked/dropped `File[]` |
|
|
123
123
|
|
|
124
|
-
See [
|
|
124
|
+
See [Base Components](/examples/blocks.html#/docs/guide/owl-components) for how to load `@base/owl` and `dist/baseui.templates.xml`.
|
|
125
125
|
|
|
126
126
|
## Static component
|
|
127
127
|
|
|
@@ -4,9 +4,9 @@ Use `b-ui="avatar"` for a CDN-ready avatar component.
|
|
|
4
4
|
|
|
5
5
|
## CDN install requirements
|
|
6
6
|
|
|
7
|
-
Load the pinned
|
|
7
|
+
Load the pinned the Base UI CSS and JavaScript files; no extra dependency is required for this component.
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## Base component
|
|
10
10
|
|
|
11
11
|
```js
|
|
12
12
|
import { Avatar } from "@thebase/ui";
|
|
@@ -27,7 +27,7 @@ import { Avatar } from "@thebase/ui";
|
|
|
27
27
|
| `Avatar` | `title` | `String` | optional, native hover tooltip |
|
|
28
28
|
| `Avatar` | `className` | `String` | optional |
|
|
29
29
|
|
|
30
|
-
See [
|
|
30
|
+
See [Base Components](/examples/blocks.html#/docs/guide/owl-components) for how to load `@base/owl` and `dist/baseui.templates.xml`.
|
|
31
31
|
|
|
32
32
|
## Static component
|
|
33
33
|
|
|
@@ -53,7 +53,7 @@ Interactive components emit documented `baseui:*` events from their root element
|
|
|
53
53
|
|
|
54
54
|
## CSS variables
|
|
55
55
|
|
|
56
|
-
The component inherits
|
|
56
|
+
The component inherits the Base UI semantic tokens such as `--b-surface`, `--b-border`, `--b-primary`, and `--b-radius`.
|
|
57
57
|
|
|
58
58
|
## Accessibility behavior
|
|
59
59
|
|
|
@@ -65,7 +65,7 @@ See `examples/index.html` for a working CDN-style page.
|
|
|
65
65
|
|
|
66
66
|
## Browser support
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
The Base UI targets modern evergreen browsers that support ES modules, CSS variables, and Bootstrap 5.3.
|
|
69
69
|
|
|
70
70
|
## Test checklist
|
|
71
71
|
|
package/docs/components/badge.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Small status label for counts, states, and metadata.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Base component
|
|
6
6
|
|
|
7
7
|
```js
|
|
8
8
|
import { Badge } from "@thebase/ui";
|
|
@@ -24,7 +24,7 @@ import { Badge } from "@thebase/ui";
|
|
|
24
24
|
| `label` | `String` | alternative to default-slot children |
|
|
25
25
|
| `className` | `String` | appended to the generated `badge ...` classes |
|
|
26
26
|
|
|
27
|
-
See [
|
|
27
|
+
See [Base Components](/examples/blocks.html#/docs/guide/owl-components) for how to load `@base/owl` and `dist/baseui.templates.xml`.
|
|
28
28
|
|
|
29
29
|
## Static component
|
|
30
30
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Block Viewer
|
|
2
2
|
|
|
3
|
-
`BlockViewer` is the page-root component used by the
|
|
3
|
+
`BlockViewer` is the page-root component used by the Base UI block gallery detail pages (`examples/blocks/*.html`). It reads a title/description from `document.body.dataset`, renders a sample block's markup from a `[b-block-code-template]` script tag into a live preview panel, and offers a preview/code toggle with desktop/tablet/mobile viewport switching and a "copy code" action.
|
|
4
4
|
|
|
5
5
|
## CDN install requirements
|
|
6
6
|
|
|
7
|
-
Load the pinned
|
|
7
|
+
Load the pinned the Base UI CSS and JavaScript files, plus the block-viewer adapter bundle (it is not part of `baseui.min.js`, since it pulls in the full component export surface only when a block sample needs it — but it's self-contained, no import map required):
|
|
8
8
|
|
|
9
9
|
```html
|
|
10
10
|
<link rel="stylesheet" href="/dist/baseui.min.css">
|
|
@@ -12,7 +12,7 @@ Load the pinned BaseUI CSS and JavaScript files, plus the block-viewer adapter b
|
|
|
12
12
|
<script src="/dist/baseui.min.js" defer></script>
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## Base component
|
|
16
16
|
|
|
17
17
|
```js
|
|
18
18
|
import { BlockViewer } from "@base/component";
|
|
@@ -37,7 +37,7 @@ import { BlockViewer } from "@base/component";
|
|
|
37
37
|
</body>
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
`thebase.mountAll()` (called automatically on `DOMContentLoaded`) mounts the `b-ui="block-viewer"` element as a full
|
|
40
|
+
`thebase.mountAll()` (called automatically on `DOMContentLoaded`) mounts the `b-ui="block-viewer"` element as a full application, using the block's own inline template as its live preview and its serialized text as the "Code" panel.
|
|
41
41
|
|
|
42
42
|
## Options and attributes
|
|
43
43
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Displays the path to the current resource using a hierarchy of links.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Base component
|
|
6
6
|
|
|
7
7
|
```js
|
|
8
8
|
import {
|
|
@@ -48,7 +48,7 @@ import {
|
|
|
48
48
|
| `BreadcrumbSeparator` | `className` | `String` | optional; custom children override the chevron |
|
|
49
49
|
| `BreadcrumbEllipsis` | `className` | `String` | optional |
|
|
50
50
|
|
|
51
|
-
See [
|
|
51
|
+
See [Base Components](/examples/blocks.html#/docs/guide/owl-components) for how to load `@base/owl` and `dist/baseui.templates.xml`.
|
|
52
52
|
|
|
53
53
|
## Static component
|
|
54
54
|
|
|
@@ -63,7 +63,7 @@ See [Pure Owl Components](/examples/blocks.html#/docs/guide/owl-components) for
|
|
|
63
63
|
</nav>
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
The Base UI adds the shadcn/Nova breadcrumb classes, inserts chevron separators when none are authored, styles links and the current page, and marks the current page with `aria-current="page"`.
|
|
67
67
|
|
|
68
68
|
## Dropdown
|
|
69
69
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Bubble
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Base component
|
|
4
4
|
|
|
5
5
|
```js
|
|
6
6
|
import { Bubble } from "@thebase/ui";
|
|
@@ -39,7 +39,7 @@ import { Bubble } from "@thebase/ui";
|
|
|
39
39
|
| --- | --- | --- | --- |
|
|
40
40
|
| `Bubble` | `className` | `String` | optional |
|
|
41
41
|
|
|
42
|
-
See [
|
|
42
|
+
See [Base Components](/examples/blocks.html#/docs/guide/owl-components) for how to load `@base/owl` and `dist/baseui.templates.xml`.
|
|
43
43
|
|
|
44
44
|
## Static component
|
|
45
45
|
|