rei-kit 3.2.1 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/components/CopyButton.vue.d.ts +34 -1
- package/dist/index.js +24 -17
- package/dist/index.js.map +1 -1
- package/dist/styles.css +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -165,7 +165,7 @@ app, and the case *least* favourable to this kit:
|
|
|
165
165
|
|
|
166
166
|
| Kit | JS | CSS | Total |
|
|
167
167
|
| -------------------- | ---------: | ----------: | ----------: |
|
|
168
|
-
| **rei-kit 3.
|
|
168
|
+
| **rei-kit 3.3.0** | **3.6 KB** | **23.1 KB** | **26.8 KB** |
|
|
169
169
|
| element-plus 2.14.6 | 27.3 KB | 6.0 KB | 33.3 KB |
|
|
170
170
|
| naive-ui 2.45.3 | 51.2 KB | — | 51.2 KB |
|
|
171
171
|
| primevue 5.0.1 | 53.6 KB | — | 53.6 KB |
|
|
@@ -177,7 +177,7 @@ a data table, a tooltip and a card. A screen rather than a demo:
|
|
|
177
177
|
|
|
178
178
|
| Kit | JS | CSS | Total |
|
|
179
179
|
| -------------------- | ---------: | ----------: | -----------: |
|
|
180
|
-
| **rei-kit 3.
|
|
180
|
+
| **rei-kit 3.3.0** | **8.6 KB** | **23.1 KB** | **31.7 KB** |
|
|
181
181
|
| element-plus 2.14.6 | 90.1 KB | 14.0 KB | 104.1 KB |
|
|
182
182
|
| naive-ui 2.45.3 | 132.4 KB | — | 132.4 KB |
|
|
183
183
|
| primevue 5.0.1 | 135.8 KB | — | 135.8 KB |
|
|
@@ -234,7 +234,7 @@ Each claim here is enforced by something that fails, not by a promise.
|
|
|
234
234
|
|
|
235
235
|
## Status
|
|
236
236
|
|
|
237
|
-
**v3.
|
|
237
|
+
**v3.3.0 — three consumers.**
|
|
238
238
|
|
|
239
239
|
| | |
|
|
240
240
|
| ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
@@ -21,13 +21,46 @@ type __VLS_Props = {
|
|
|
21
21
|
errorLabel?: string | undefined;
|
|
22
22
|
/** Show the label beside the icon, rather than only to assistive tech. */
|
|
23
23
|
withText?: boolean | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* `unstyled` keeps the copying and drops the surface and the icon.
|
|
26
|
+
*
|
|
27
|
+
* The announcement is the part that is laborious and the part that is
|
|
28
|
+
* dropped: a copy button that says nothing leaves somebody who cannot see
|
|
29
|
+
* the tick pressing it twice. Three places on this kit's own site wrote
|
|
30
|
+
* their own copy button to get a different shape — a pill in a code block's
|
|
31
|
+
* bar, a whole install command — and all three lost the announcement on the
|
|
32
|
+
* way. That is the gap this closes: the behaviour without the paint, the
|
|
33
|
+
* same answer `BaseButton` and `BaseInput` give.
|
|
34
|
+
*
|
|
35
|
+
* Unstyled brings no focus ring either, so give it one.
|
|
36
|
+
*/
|
|
37
|
+
variant?: 'default' | 'unstyled' | undefined;
|
|
24
38
|
};
|
|
25
|
-
|
|
39
|
+
/**
|
|
40
|
+
* The button's content, for a shape the icon-and-label pair does not cover.
|
|
41
|
+
*
|
|
42
|
+
* Given one, set `withText` as well: the `aria-label` exists to name a button
|
|
43
|
+
* whose only content is an icon, and a slot that renders words does not need
|
|
44
|
+
* naming twice.
|
|
45
|
+
*/
|
|
46
|
+
type __VLS_Slots = {
|
|
47
|
+
default?: (props: {
|
|
48
|
+
copied: boolean;
|
|
49
|
+
failed: boolean;
|
|
50
|
+
}) => unknown;
|
|
51
|
+
};
|
|
52
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
26
53
|
failed: () => any;
|
|
27
54
|
copied: () => any;
|
|
28
55
|
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
29
56
|
onFailed?: () => any;
|
|
30
57
|
onCopied?: () => any;
|
|
31
58
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
59
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
32
60
|
declare const _default: typeof __VLS_export;
|
|
33
61
|
export default _default;
|
|
62
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
63
|
+
new (): {
|
|
64
|
+
$slots: S;
|
|
65
|
+
};
|
|
66
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -3539,10 +3539,18 @@ var CopyButton_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
|
|
|
3539
3539
|
withText: {
|
|
3540
3540
|
type: Boolean,
|
|
3541
3541
|
default: false
|
|
3542
|
-
}
|
|
3542
|
+
},
|
|
3543
|
+
variant: { default: "default" }
|
|
3543
3544
|
},
|
|
3544
3545
|
emits: ["copied", "failed"],
|
|
3545
3546
|
setup(__props, { emit: __emit }) {
|
|
3547
|
+
/**
|
|
3548
|
+
* The button's content, for a shape the icon-and-label pair does not cover.
|
|
3549
|
+
*
|
|
3550
|
+
* Given one, set `withText` as well: the `aria-label` exists to name a button
|
|
3551
|
+
* whose only content is an icon, and a slot that renders words does not need
|
|
3552
|
+
* naming twice.
|
|
3553
|
+
*/
|
|
3546
3554
|
const emit = __emit;
|
|
3547
3555
|
const state = ref("idle");
|
|
3548
3556
|
let timer = null;
|
|
@@ -3564,28 +3572,27 @@ var CopyButton_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
|
|
|
3564
3572
|
return (_ctx, _cache) => {
|
|
3565
3573
|
return openBlock(), createElementBlock("button", {
|
|
3566
3574
|
type: "button",
|
|
3567
|
-
class: normalizeClass(["rk-copy control focus-ring", {
|
|
3575
|
+
class: normalizeClass(__props.variant === "unstyled" ? "" : ["rk-copy control focus-ring", {
|
|
3568
3576
|
"is-copied": state.value === "copied",
|
|
3569
3577
|
"with-text": __props.withText
|
|
3570
3578
|
}]),
|
|
3571
3579
|
"aria-label": __props.withText ? void 0 : state.value === "copied" ? __props.copiedLabel : __props.copyLabel,
|
|
3572
3580
|
onClick: copy
|
|
3573
|
-
}, [
|
|
3574
|
-
state.value === "copied"
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
], 10, _hoisted_1$14);
|
|
3581
|
+
}, [renderSlot(_ctx.$slots, "default", {
|
|
3582
|
+
copied: state.value === "copied",
|
|
3583
|
+
failed: state.value === "failed"
|
|
3584
|
+
}, () => [state.value === "copied" ? (openBlock(), createBlock(unref(Check), {
|
|
3585
|
+
key: 0,
|
|
3586
|
+
class: "size-4 shrink-0",
|
|
3587
|
+
"aria-hidden": "true"
|
|
3588
|
+
})) : (openBlock(), createBlock(unref(Copy), {
|
|
3589
|
+
key: 1,
|
|
3590
|
+
class: "size-4 shrink-0",
|
|
3591
|
+
"aria-hidden": "true"
|
|
3592
|
+
})), __props.withText ? (openBlock(), createElementBlock("span", _hoisted_2$12, toDisplayString(state.value === "copied" ? __props.copiedLabel : __props.copyLabel), 1)) : createCommentVNode("", true)], true), createElementVNode("span", _hoisted_3$11, toDisplayString(state.value === "copied" ? __props.copiedLabel : state.value === "failed" ? __props.errorLabel ?? "" : ""), 1)], 10, _hoisted_1$14);
|
|
3586
3593
|
};
|
|
3587
3594
|
}
|
|
3588
|
-
}), [["__scopeId", "data-v-
|
|
3595
|
+
}), [["__scopeId", "data-v-446f2f89"]]);
|
|
3589
3596
|
//#endregion
|
|
3590
3597
|
//#region src/components/CodeBlock.vue?vue&type=script&setup=true&lang.ts
|
|
3591
3598
|
var _hoisted_1$13 = {
|
|
@@ -5125,7 +5132,7 @@ function createI18nRuntime(options) {
|
|
|
5125
5132
|
*
|
|
5126
5133
|
* The fallback keeps `vitest` and `vite dev` honest, where no define runs.
|
|
5127
5134
|
*/
|
|
5128
|
-
var VERSION = "3.
|
|
5135
|
+
var VERSION = "3.3.0";
|
|
5129
5136
|
//#endregion
|
|
5130
5137
|
export { ActivityGrid_default as ActivityGrid, AnnounceHost_default as AnnounceHost, AppError, AvatarStack_default as AvatarStack, BarChart_default as BarChart, BaseAlert_default as BaseAlert, BaseAvatar_default as BaseAvatar, BaseBadge_default as BaseBadge, BaseButton_default as BaseButton, BaseCalendar_default as BaseCalendar, BaseCard_default as BaseCard, BaseCheckbox_default as BaseCheckbox, BaseChip_default as BaseChip, BaseCombobox_default as BaseCombobox, BaseDatePicker_default as BaseDatePicker, BaseInput_default as BaseInput, BaseKbd_default as BaseKbd, BaseLink_default as BaseLink, BaseListbox_default as BaseListbox, BaseMenu_default as BaseMenu, BasePopconfirm_default as BasePopconfirm, BasePopover_default as BasePopover, BaseRadioGroup_default as BaseRadioGroup, BaseRating_default as BaseRating, BaseSelect_default as BaseSelect, BaseSeparator_default as BaseSeparator, BaseSheet_default as BaseSheet, BaseSkeleton_default as BaseSkeleton, BaseSlider_default as BaseSlider, BaseSpinner_default as BaseSpinner, BaseStepper_default as BaseStepper, BaseSwitch_default as BaseSwitch, BaseTable_default as BaseTable, BaseTextarea_default as BaseTextarea, BaseTimeline_default as BaseTimeline, CircularProgress_default as CircularProgress, CodeBlock_default as CodeBlock, ColorPicker_default as ColorPicker, CopyButton_default as CopyButton, DescriptionList_default as DescriptionList, DonutChart_default as DonutChart, EmptyState_default as EmptyState, ErrorBoundary_default as ErrorBoundary, ErrorSummary_default as ErrorSummary, FileDrop_default as FileDrop, FormField_default as FormField, GoogleButton_default as GoogleButton, LocaleLinks_default as LocaleLinks, MATERIALS, NumberInput_default as NumberInput, PALETTES, PageContainer_default as PageContainer, PageHeader_default as PageHeader, PasswordInput_default as PasswordInput, PinInput_default as PinInput, PriceCard_default as PriceCard, ProgressBar_default as ProgressBar, SHEET_ROOT_ID, ScrollArea_default as ScrollArea, SectionHeading_default as SectionHeading, SegmentedControl_default as SegmentedControl, SettingsGroup_default as SettingsGroup, SettingsRow_default as SettingsRow, SkeletonList_default as SkeletonList, SliderField_default as SliderField, StatCard_default as StatCard, TabBar_default as TabBar, TagsInput_default as TagsInput, TimePicker_default as TimePicker, ToastHost_default as ToastHost, ToggleGroup_default as ToggleGroup, ToneDot_default as ToneDot, VERSION, VirtualList_default as VirtualList, addDays, announce, applyMaterial, applyPalette, applyTheme, createI18nRuntime, downloadJson, eachDayOfYear, elementDirection, ensureSheetRoot, formatDate, formatNumber, fromDateKey, horizontalStep, isApplePortable, isInstalled, isMaterial, isPaletteName, isThemePreference, lastNDays, leadingBlanks, needsIosInstall, readStoredTheme, registerErrorMapper, relativeDayLabel, safeRedirect, setFormatLocale, setMaterialStorageKey, setPaletteStorageKey, setThemeStorageKey, startOfWeek, tapFeedback, textDirection, toAppError, toDateKey, toRedirectPath, todayKey, useAnnounce, useDebouncedCallback, useDragScroll, useMaterial, useMediaQuery, useOnline, usePalette, useTheme, useToast, useToday, useVisualViewport };
|
|
5131
5138
|
|