@openameba/spindle-ui 3.1.0 → 3.1.1

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # Change Log
2
2
 
3
+ ## 3.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1561](https://github.com/openameba/spindle/pull/1561) [`96d5e14`](https://github.com/openameba/spindle/commit/96d5e14c1be6e6d817ad28bb533e4a8c4d260804) Thanks [@yasuda-shin](https://github.com/yasuda-shin)! - ButtonSwitchに`ariaLabelledby`プロパティを追加し、外部ラベルとの関連付けをサポート
8
+
3
9
  All notable changes to this project will be documented in this file.
4
10
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
11
 
@@ -7,6 +7,7 @@ type Props = {
7
7
  value: string;
8
8
  }[];
9
9
  onClick: (value: string) => void;
10
+ ariaLabelledby?: string;
10
11
  };
11
12
  export declare const ButtonSwitch: React.FC<Props>;
12
13
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonSwitch.d.ts","sourceRoot":"","sources":["../../../src/Form/ButtonSwitch/ButtonSwitch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAG9D,KAAK,KAAK,GAAG;IACX,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE;QACP,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;KACf,EAAE,CAAC;IACJ,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC,CAAC;AAIF,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAsExC,CAAC"}
1
+ {"version":3,"file":"ButtonSwitch.d.ts","sourceRoot":"","sources":["../../../src/Form/ButtonSwitch/ButtonSwitch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAG9D,KAAK,KAAK,GAAG;IACX,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE;QACP,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;KACf,EAAE,CAAC;IACJ,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAIF,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CA4ExC,CAAC"}
@@ -41,7 +41,7 @@ var react_1 = __importStar(require("react"));
41
41
  var CheckBold_1 = __importDefault(require("../../Icon/CheckBold"));
42
42
  var BLOCK_NAME = 'spui-ButtonSwitch';
43
43
  var ButtonSwitch = function (_a) {
44
- var id = _a.id, value = _a.value, options = _a.options, onClick = _a.onClick;
44
+ var id = _a.id, value = _a.value, options = _a.options, onClick = _a.onClick, ariaLabelledby = _a.ariaLabelledby;
45
45
  var buttonsRef = (0, react_1.useRef)([]);
46
46
  options.forEach(function (_, index) {
47
47
  buttonsRef.current[index] = (0, react_1.createRef)();
@@ -70,7 +70,7 @@ var ButtonSwitch = function (_a) {
70
70
  }
71
71
  }
72
72
  }, [options, onClick]);
73
- return (react_1.default.createElement("div", { id: id, className: BLOCK_NAME, role: "group" }, options.map(function (option, index) { return (react_1.default.createElement("button", { type: "button", "aria-pressed": value === option.value, onKeyDown: function (e) { return handleKeydown(e, index); }, key: option.value, className: "".concat(BLOCK_NAME, "-button"), onClick: function () { return onClick === null || onClick === void 0 ? void 0 : onClick(option.value); }, ref: buttonsRef.current[index] },
73
+ return (react_1.default.createElement("div", { role: "group", id: id, className: BLOCK_NAME, "aria-labelledby": ariaLabelledby }, options.map(function (option, index) { return (react_1.default.createElement("button", { type: "button", "aria-pressed": value === option.value, onKeyDown: function (e) { return handleKeydown(e, index); }, key: option.value, className: "".concat(BLOCK_NAME, "-button"), onClick: function () { return onClick === null || onClick === void 0 ? void 0 : onClick(option.value); }, ref: buttonsRef.current[index] },
74
74
  value === option.value && (react_1.default.createElement(CheckBold_1.default, { "aria-hidden": "true", className: "".concat(BLOCK_NAME, "-icon"), width: 12, height: 12 })),
75
75
  react_1.default.createElement("span", { className: "".concat(BLOCK_NAME, "-label") }, option.label))); })));
76
76
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonSwitch.js","sourceRoot":"","sources":["../../../src/Form/ButtonSwitch/ButtonSwitch.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA8D;AAC9D,mEAA6C;AAY7C,IAAM,UAAU,GAAG,mBAAmB,CAAC;AAEhC,IAAM,YAAY,GAAoB,UAAC,EAK7C;QAJC,EAAE,QAAA,EACF,KAAK,WAAA,EACL,OAAO,aAAA,EACP,OAAO,aAAA;IAEP,IAAM,UAAU,GAAG,IAAA,cAAM,EAA8C,EAAE,CAAC,CAAC;IAE3E,OAAO,CAAC,OAAO,CAAC,UAAC,CAAC,EAAE,KAAK;QACvB,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,IAAA,iBAAS,GAAqB,CAAC;IAC7D,CAAC,CAAC,CAAC;IAEH,IAAM,aAAa,GAAG,IAAA,mBAAW,EAC/B,UAAC,CAAyC,EAAE,KAAa;QACvD,IAAM,WAAW,GAAG,UAAC,MAAc;YACjC,IAAM,SAAS,GACb,UAAU,CAAC,OAAO,CAChB,CAAC,OAAO,CAAC,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CACnD,CAAC;YACJ,IAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC;YACjC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,EAAE,CAAC;YAChB,IAAI,OAAO,EAAE,CAAC;gBACZ,OAAO,CACL,OAAO,CAAC,CA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AM,EAAE,EAAE,GACV,CACH;QACD,wCAAM,SAAS,EAAE,UAAG,UAAU,WAAQ,IAAG,MAAM,CAAC,KAAK,CAAQ,CACtD,CACV,EApB+B,CAoB/B,CAAC,CACE,CACP,CAAC;AACJ,CAAC,CAAC;AA5EW,QAAA,YAAY,gBA4EvB"}
@@ -1,7 +1,7 @@
1
1
  import React, { createRef, useCallback, useRef } from 'react';
2
2
  import CheckBold from "../../Icon/CheckBold.mjs";
3
3
  const BLOCK_NAME = 'spui-ButtonSwitch';
4
- export const ButtonSwitch = ({ id, value, options, onClick, }) => {
4
+ export const ButtonSwitch = ({ id, value, options, onClick, ariaLabelledby, }) => {
5
5
  const buttonsRef = useRef([]);
6
6
  options.forEach((_, index) => {
7
7
  buttonsRef.current[index] = createRef();
@@ -30,7 +30,7 @@ export const ButtonSwitch = ({ id, value, options, onClick, }) => {
30
30
  }
31
31
  }
32
32
  }, [options, onClick]);
33
- return (React.createElement("div", { id: id, className: BLOCK_NAME, role: "group" }, options.map((option, index) => (React.createElement("button", { type: "button", "aria-pressed": value === option.value, onKeyDown: (e) => handleKeydown(e, index), key: option.value, className: `${BLOCK_NAME}-button`, onClick: () => onClick?.(option.value), ref: buttonsRef.current[index] },
33
+ return (React.createElement("div", { role: "group", id: id, className: BLOCK_NAME, "aria-labelledby": ariaLabelledby }, options.map((option, index) => (React.createElement("button", { type: "button", "aria-pressed": value === option.value, onKeyDown: (e) => handleKeydown(e, index), key: option.value, className: `${BLOCK_NAME}-button`, onClick: () => onClick?.(option.value), ref: buttonsRef.current[index] },
34
34
  value === option.value && (React.createElement(CheckBold, { "aria-hidden": "true", className: `${BLOCK_NAME}-icon`, width: 12, height: 12 })),
35
35
  React.createElement("span", { className: `${BLOCK_NAME}-label` }, option.label))))));
36
36
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openameba/spindle-ui",
3
- "version": "3.1.0",
3
+ "version": "3.1.1",
4
4
  "main": "./index.js",
5
5
  "module": "./index.mjs",
6
6
  "types": "./index.d.ts",
@@ -79,7 +79,7 @@
79
79
  "@testing-library/react": "16.3.0",
80
80
  "@testing-library/user-event": "14.6.1",
81
81
  "@types/jest": "30.0.0",
82
- "@types/react": "19.0.6",
82
+ "@types/react": "19.2.2",
83
83
  "autoprefixer": "10.4.21",
84
84
  "bundlewatch": "0.4.1",
85
85
  "cssnano": "7.1.1",
@@ -92,8 +92,8 @@
92
92
  "postcss": "8.5.6",
93
93
  "postcss-cli": "11.0.1",
94
94
  "postcss-import": "16.1.1",
95
- "react": "19.0.0",
96
- "react-dom": "19.0.0",
95
+ "react": "19.2.0",
96
+ "react-dom": "19.2.0",
97
97
  "reg-keygen-git-hash-plugin": "0.14.5",
98
98
  "reg-notify-github-plugin": "0.14.5",
99
99
  "reg-publish-gcs-plugin": "0.14.4",
@@ -104,6 +104,5 @@
104
104
  "stylelint-config-standard": "39.0.1",
105
105
  "stylelint-order": "7.0.0",
106
106
  "stylelint-selector-bem-pattern": "4.0.1"
107
- },
108
- "gitHead": "c94bbfa74fd6d2c97f9bbb74037d52ebae0736d7"
107
+ }
109
108
  }
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import 'dialog-polyfill/dist/dialog-polyfill.css';
3
- export declare function DialogExample(): React.JSX.Element;
4
- export declare function StyleOnly(): React.JSX.Element;
5
- export declare function ButtonRow(): React.JSX.Element;
6
- export declare function ButtonColumn(): React.JSX.Element;
7
- export declare function ButtonColumnWithSubtleButton(): React.JSX.Element;
8
- //# sourceMappingURL=DialogExample.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DialogExample.d.ts","sourceRoot":"","sources":["../../src/Dialog/DialogExample.tsx"],"names":[],"mappings":"AACA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAK3D,OAAO,0CAA0C,CAAC;AAUlD,wBAAgB,aAAa,sBA0C5B;AAED,wBAAgB,SAAS,sBAYxB;AAED,wBAAgB,SAAS,sBAexB;AAED,wBAAgB,YAAY,sBAe3B;AAED,wBAAgB,4BAA4B,sBAa3C"}
@@ -1,103 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- var __importDefault = (this && this.__importDefault) || function (mod) {
36
- return (mod && mod.__esModule) ? mod : { "default": mod };
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.DialogExample = DialogExample;
40
- exports.StyleOnly = StyleOnly;
41
- exports.ButtonRow = ButtonRow;
42
- exports.ButtonColumn = ButtonColumn;
43
- exports.ButtonColumnWithSubtleButton = ButtonColumnWithSubtleButton;
44
- var dialog_polyfill_1 = __importDefault(require("dialog-polyfill"));
45
- var react_1 = __importStar(require("react"));
46
- var Button_1 = require("../Button");
47
- var SubtleButton_1 = require("../SubtleButton");
48
- var Dialog_1 = require("./Dialog");
49
- require("dialog-polyfill/dist/dialog-polyfill.css");
50
- function useDialogpolyfill(ref) {
51
- (0, react_1.useEffect)(function () {
52
- if (ref.current) {
53
- dialog_polyfill_1.default.registerDialog(ref.current);
54
- }
55
- }, [ref]);
56
- }
57
- function DialogExample() {
58
- var _a = (0, react_1.useState)(false), open = _a[0], setOpen = _a[1];
59
- var dialogRef = (0, react_1.useRef)(null);
60
- var handleOpenButtonClick = function () { return setOpen(true); };
61
- var handleDialogCancel = function () { return setOpen(false); };
62
- var handleDialogClose = function () { return setOpen(false); };
63
- useDialogpolyfill(dialogRef);
64
- return (react_1.default.createElement(react_1.default.Fragment, null,
65
- react_1.default.createElement(Button_1.Button, { "aria-haspopup": "true", onClick: handleOpenButtonClick, size: "medium", variant: "neutral" }, "\u958B\u304F"),
66
- react_1.default.createElement(Dialog_1.Dialog.Frame, { "aria-describedby": "dialog-description", "aria-labelledby": "dialog-title", ref: dialogRef, open: open, onCancel: handleDialogCancel, onClose: handleDialogClose },
67
- react_1.default.createElement(Dialog_1.Dialog.Title, { id: "dialog-title" }, "\u30BF\u30A4\u30C8\u30EB\u3067\u3059\u3088"),
68
- react_1.default.createElement(Dialog_1.Dialog.Body, { id: "dialog-description" }, "\u3053\u3053\u306B\u672C\u6587\u304C\u5165\u308A\u307E\u3059\u3088"),
69
- react_1.default.createElement(Dialog_1.Dialog.ButtonGroup, null,
70
- react_1.default.createElement(Button_1.Button, { layout: "fullWidth", size: "medium" }, "OK")))));
71
- }
72
- function StyleOnly() {
73
- return (react_1.default.createElement(Dialog_1.Dialog.StyleOnly, null,
74
- react_1.default.createElement(Dialog_1.Dialog.Title, null, "\u30BF\u30A4\u30C8\u30EB\u3067\u3059\u3088"),
75
- react_1.default.createElement(Dialog_1.Dialog.Body, null, "\u3053\u3053\u306B\u672C\u6587\u304C\u5165\u308A\u307E\u3059\u3088"),
76
- react_1.default.createElement(Dialog_1.Dialog.ButtonGroup, null,
77
- react_1.default.createElement(Button_1.Button, { layout: "fullWidth", size: "medium" }, "OK"))));
78
- }
79
- function ButtonRow() {
80
- return (react_1.default.createElement(Dialog_1.Dialog.StyleOnly, null,
81
- react_1.default.createElement(Dialog_1.Dialog.Title, null, "\u30BF\u30A4\u30C8\u30EB\u3067\u3059\u3088"),
82
- react_1.default.createElement(Dialog_1.Dialog.Body, null, "\u3053\u3053\u306B\u672C\u6587\u304C\u5165\u308A\u307E\u3059\u3088"),
83
- react_1.default.createElement(Dialog_1.Dialog.ButtonGroup, null,
84
- react_1.default.createElement(Button_1.Button, { layout: "fullWidth", size: "medium", variant: "neutral" }, "\u30AD\u30E3\u30F3\u30BB\u30EB"),
85
- react_1.default.createElement(Button_1.Button, { layout: "fullWidth", size: "medium", variant: "danger", type: "button" }, "\u524A\u9664\u3059\u308B"))));
86
- }
87
- function ButtonColumn() {
88
- return (react_1.default.createElement(Dialog_1.Dialog.StyleOnly, null,
89
- react_1.default.createElement(Dialog_1.Dialog.Title, null, "\u30BF\u30A4\u30C8\u30EB\u3067\u3059\u3088"),
90
- react_1.default.createElement(Dialog_1.Dialog.Body, null, "\u3053\u3053\u306B\u672C\u6587\u304C\u5165\u308A\u307E\u3059\u3088"),
91
- react_1.default.createElement(Dialog_1.Dialog.ButtonGroup, { direction: "column" },
92
- react_1.default.createElement(Button_1.Button, { layout: "fullWidth", size: "medium", type: "button" }, "Spindle\u3092\u30D5\u30A9\u30ED\u30FC\u3059\u308B"),
93
- react_1.default.createElement(Button_1.Button, { layout: "fullWidth", size: "medium", variant: "neutral" }, "\u30AD\u30E3\u30F3\u30BB\u30EB"))));
94
- }
95
- function ButtonColumnWithSubtleButton() {
96
- return (react_1.default.createElement(Dialog_1.Dialog.StyleOnly, null,
97
- react_1.default.createElement(Dialog_1.Dialog.Title, null, "\u30BF\u30A4\u30C8\u30EB\u3067\u3059\u3088"),
98
- react_1.default.createElement(Dialog_1.Dialog.Body, null, "\u3053\u3053\u306B\u672C\u6587\u304C\u5165\u308A\u307E\u3059\u3088"),
99
- react_1.default.createElement(Dialog_1.Dialog.ButtonGroup, { direction: "column" },
100
- react_1.default.createElement(Button_1.Button, { layout: "fullWidth", size: "medium", type: "button" }, "Spindle\u3092\u30D5\u30A9\u30ED\u30FC\u3059\u308B"),
101
- react_1.default.createElement(SubtleButton_1.SubtleButton, { size: "medium" }, "\u3068\u3058\u308B"))));
102
- }
103
- //# sourceMappingURL=DialogExample.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DialogExample.js","sourceRoot":"","sources":["../../src/Dialog/DialogExample.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,sCA0CC;AAED,8BAYC;AAED,8BAeC;AAED,oCAeC;AAED,oEAaC;AAzHD,oEAA6C;AAC7C,6CAA2D;AAC3D,oCAAmC;AACnC,gDAA+C;AAC/C,mCAAkC;AAElC,oDAAkD;AAElD,SAAS,iBAAiB,CAAC,GAA8C;IACvE,IAAA,iBAAS,EAAC;QACR,IAAI,GAAG,CAAC,OAAO,EAAE,CAAC;YAChB,yBAAc,CAAC,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;AACZ,CAAC;AAED,SAAgB,aAAa;IACrB,IAAA,KAAkB,IAAA,gBAAQ,EAAC,KAAK,CAAC,EAAhC,IAAI,QAAA,EAAE,OAAO,QAAmB,CAAC;IACxC,IAAM,SAAS,GAAG,IAAA,cAAM,EAA2B,IAAI,CAAC,CAAC;IAEzD,IAAM,qBAAqB,GAAG,cAAM,OAAA,OAAO,CAAC,IAAI,CAAC,EAAb,CAAa,CAAC;IAElD,IAAM,kBAAkB,GAAG,cAAM,OAAA,OAAO,CAAC,KAAK,CAAC,EAAd,CAAc,CAAC;IAEhD,IAAM,iBAAiB,GAAG,cAAM,OAAA,OAAO,CAAC,KAAK,CAAC,EAAd,CAAc,CAAC;IAE/C,iBAAiB,CAAC,SAA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IAAI,EAAC,QAAQ,+BAE9D,CACU,CACJ,CACpB,CAAC;AACJ,CAAC;AAED,SAAgB,YAAY;IAC1B,OAAO,CACL,8BAAC,eAAM,CAAC,SAAS;QACf,8BAAC,eAAM,CAAC,KAAK,qDAAuB;QACpC,8BAAC,eAAM,CAAC,IAAI,6EAA0B;QACtC,8BAAC,eAAM,CAAC,WAAW,IAAC,SAAS,EAAC,QAAQ;YACpC,8BAAC,eAAM,IAAC,MAAM,EAAC,WAAW,EAAC,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,QAAQ,wDAE7C;YACT,8BAAC,eAAM,IAAC,MAAM,EAAC,WAAW,EAAC,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAC,SAAS,qCAEjD,CACU,CACJ,CACpB,CAAC;AACJ,CAAC;AAED,SAAgB,4BAA4B;IAC1C,OAAO,CACL,8BAAC,eAAM,CAAC,SAAS;QACf,8BAAC,eAAM,CAAC,KAAK,qDAAuB;QACpC,8BAAC,eAAM,CAAC,IAAI,6EAA0B;QACtC,8BAAC,eAAM,CAAC,WAAW,IAAC,SAAS,EAAC,QAAQ;YACpC,8BAAC,eAAM,IAAC,MAAM,EAAC,WAAW,EAAC,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,QAAQ,wDAE7C;YACT,8BAAC,2BAAY,IAAC,IAAI,EAAC,QAAQ,yBAAmB,CAC3B,CACJ,CACpB,CAAC;AACJ,CAAC"}
@@ -1,59 +0,0 @@
1
- import dialogPolyfill from 'dialog-polyfill';
2
- import React, { useEffect, useRef, useState } from 'react';
3
- import { Button } from "../Button/index.mjs";
4
- import { SubtleButton } from "../SubtleButton/index.mjs";
5
- import { Dialog } from "./Dialog.mjs";
6
- import 'dialog-polyfill/dist/dialog-polyfill.css';
7
- function useDialogpolyfill(ref) {
8
- useEffect(() => {
9
- if (ref.current) {
10
- dialogPolyfill.registerDialog(ref.current);
11
- }
12
- }, [ref]);
13
- }
14
- export function DialogExample() {
15
- const [open, setOpen] = useState(false);
16
- const dialogRef = useRef(null);
17
- const handleOpenButtonClick = () => setOpen(true);
18
- const handleDialogCancel = () => setOpen(false);
19
- const handleDialogClose = () => setOpen(false);
20
- useDialogpolyfill(dialogRef);
21
- return (React.createElement(React.Fragment, null,
22
- React.createElement(Button, { "aria-haspopup": "true", onClick: handleOpenButtonClick, size: "medium", variant: "neutral" }, "\u958B\u304F"),
23
- React.createElement(Dialog.Frame, { "aria-describedby": "dialog-description", "aria-labelledby": "dialog-title", ref: dialogRef, open: open, onCancel: handleDialogCancel, onClose: handleDialogClose },
24
- React.createElement(Dialog.Title, { id: "dialog-title" }, "\u30BF\u30A4\u30C8\u30EB\u3067\u3059\u3088"),
25
- React.createElement(Dialog.Body, { id: "dialog-description" }, "\u3053\u3053\u306B\u672C\u6587\u304C\u5165\u308A\u307E\u3059\u3088"),
26
- React.createElement(Dialog.ButtonGroup, null,
27
- React.createElement(Button, { layout: "fullWidth", size: "medium" }, "OK")))));
28
- }
29
- export function StyleOnly() {
30
- return (React.createElement(Dialog.StyleOnly, null,
31
- React.createElement(Dialog.Title, null, "\u30BF\u30A4\u30C8\u30EB\u3067\u3059\u3088"),
32
- React.createElement(Dialog.Body, null, "\u3053\u3053\u306B\u672C\u6587\u304C\u5165\u308A\u307E\u3059\u3088"),
33
- React.createElement(Dialog.ButtonGroup, null,
34
- React.createElement(Button, { layout: "fullWidth", size: "medium" }, "OK"))));
35
- }
36
- export function ButtonRow() {
37
- return (React.createElement(Dialog.StyleOnly, null,
38
- React.createElement(Dialog.Title, null, "\u30BF\u30A4\u30C8\u30EB\u3067\u3059\u3088"),
39
- React.createElement(Dialog.Body, null, "\u3053\u3053\u306B\u672C\u6587\u304C\u5165\u308A\u307E\u3059\u3088"),
40
- React.createElement(Dialog.ButtonGroup, null,
41
- React.createElement(Button, { layout: "fullWidth", size: "medium", variant: "neutral" }, "\u30AD\u30E3\u30F3\u30BB\u30EB"),
42
- React.createElement(Button, { layout: "fullWidth", size: "medium", variant: "danger", type: "button" }, "\u524A\u9664\u3059\u308B"))));
43
- }
44
- export function ButtonColumn() {
45
- return (React.createElement(Dialog.StyleOnly, null,
46
- React.createElement(Dialog.Title, null, "\u30BF\u30A4\u30C8\u30EB\u3067\u3059\u3088"),
47
- React.createElement(Dialog.Body, null, "\u3053\u3053\u306B\u672C\u6587\u304C\u5165\u308A\u307E\u3059\u3088"),
48
- React.createElement(Dialog.ButtonGroup, { direction: "column" },
49
- React.createElement(Button, { layout: "fullWidth", size: "medium", type: "button" }, "Spindle\u3092\u30D5\u30A9\u30ED\u30FC\u3059\u308B"),
50
- React.createElement(Button, { layout: "fullWidth", size: "medium", variant: "neutral" }, "\u30AD\u30E3\u30F3\u30BB\u30EB"))));
51
- }
52
- export function ButtonColumnWithSubtleButton() {
53
- return (React.createElement(Dialog.StyleOnly, null,
54
- React.createElement(Dialog.Title, null, "\u30BF\u30A4\u30C8\u30EB\u3067\u3059\u3088"),
55
- React.createElement(Dialog.Body, null, "\u3053\u3053\u306B\u672C\u6587\u304C\u5165\u308A\u307E\u3059\u3088"),
56
- React.createElement(Dialog.ButtonGroup, { direction: "column" },
57
- React.createElement(Button, { layout: "fullWidth", size: "medium", type: "button" }, "Spindle\u3092\u30D5\u30A9\u30ED\u30FC\u3059\u308B"),
58
- React.createElement(SubtleButton, { size: "medium" }, "\u3068\u3058\u308B"))));
59
- }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2022 openameba
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.