@primitiv-ui/core 0.1.61 → 0.1.62
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/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/split-button/policy.d.ts +12 -0
- package/dist/split-button/policy.js +9 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export { toggleGroupKeydown, toggleGroupTabStop, toggleGroupToggle, type ToggleG
|
|
|
7
7
|
export { radioGroupKeydown, radioGroupSelect, radioGroupTabStop, type RadioGroupKeyOutcome, type RadioGroupOrientation, type RadioGroupReadingDirection, type RadioGroupState, } from "./radio-group/policy.js";
|
|
8
8
|
export { segmentedControlKeydown, segmentedControlSelect, segmentedControlTabStop, type SegmentedControlKeyOutcome, type SegmentedControlOrientation, type SegmentedControlReadingDirection, type SegmentedControlState, } from "./segmented-control/policy.js";
|
|
9
9
|
export { checkboxCardToggle, type CheckboxCardCheckedState, type CheckboxCardState, } from "./checkbox-card/policy.js";
|
|
10
|
+
export { splitButtonOpensMenu, type SplitButtonActionKey } from "./split-button/policy.js";
|
|
10
11
|
export { sliderClosestThumb, sliderEdge, sliderKeyValue, sliderPercent, sliderPointerValue, sliderRangeInsets, sliderSetThumb, sliderSnap, sliderThumbInset, type SliderAxis, type SliderEdge, type SliderInset, type SliderOrientation, type SliderReadingDirection, type SliderScale, } from "./slider/policy.js";
|
|
11
12
|
export { collapsibleKeydown, collapsibleToggle, type CollapsibleKeyOutcome, type CollapsibleState, } from "./collapsible/policy.js";
|
|
12
13
|
export { FOCUSABLE_SELECTOR } from "./focus/focusable.js";
|
package/dist/index.js
CHANGED
|
@@ -7,6 +7,7 @@ export { toggleGroupKeydown, toggleGroupTabStop, toggleGroupToggle, } from "./to
|
|
|
7
7
|
export { radioGroupKeydown, radioGroupSelect, radioGroupTabStop, } from "./radio-group/policy.js";
|
|
8
8
|
export { segmentedControlKeydown, segmentedControlSelect, segmentedControlTabStop, } from "./segmented-control/policy.js";
|
|
9
9
|
export { checkboxCardToggle, } from "./checkbox-card/policy.js";
|
|
10
|
+
export { splitButtonOpensMenu } from "./split-button/policy.js";
|
|
10
11
|
export { sliderClosestThumb, sliderEdge, sliderKeyValue, sliderPercent, sliderPointerValue, sliderRangeInsets, sliderSetThumb, sliderSnap, sliderThumbInset, } from "./slider/policy.js";
|
|
11
12
|
export { collapsibleKeydown, collapsibleToggle, } from "./collapsible/policy.js";
|
|
12
13
|
export { FOCUSABLE_SELECTOR } from "./focus/focusable.js";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Everything a key on a split button's action depends on, as plain data. */
|
|
2
|
+
export type SplitButtonActionKey = {
|
|
3
|
+
key: string;
|
|
4
|
+
disabled: boolean;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Whether a key on the action half opens the menu: ArrowDown does, the
|
|
8
|
+
* standard split-button affordance for reaching the alternatives without
|
|
9
|
+
* tabbing past the action. Every other key is the action's own, and a
|
|
10
|
+
* disabled action opens nothing.
|
|
11
|
+
*/
|
|
12
|
+
export declare function splitButtonOpensMenu({ key, disabled }: SplitButtonActionKey): boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a key on the action half opens the menu: ArrowDown does, the
|
|
3
|
+
* standard split-button affordance for reaching the alternatives without
|
|
4
|
+
* tabbing past the action. Every other key is the action's own, and a
|
|
5
|
+
* disabled action opens nothing.
|
|
6
|
+
*/
|
|
7
|
+
export function splitButtonOpensMenu({ key, disabled }) {
|
|
8
|
+
return !disabled && key === "ArrowDown";
|
|
9
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primitiv-ui/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.62",
|
|
4
4
|
"description": "The framework-free behaviour core shared by every Primitiv surface — keyboard maps, roving-focus targets, id derivation and per-component policy, as pure functions with no DOM and no dependencies.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|