@s_and_a/arrow-ui 0.2.1 → 0.2.2

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.
@@ -0,0 +1,9 @@
1
+ import type { ArMascotArtwork } from "./ArMascot.contract";
2
+ /**
3
+ * 絵の SVG を、この部品の1つ分として画面に入れられる形にする。
4
+ * id に部品ごとの接頭辞を付ける(同じ絵を2か所に出しても、グラデーションなどの参照が混ざらない)。
5
+ * 危ない内容を含む絵は空にする。
6
+ */
7
+ export declare function scopeMascotSvg(artwork: ArMascotArtwork): string;
8
+ /** 絵の動きの CSS を、絵の名前ごとに1回だけ文書へ入れる。内容が変わっていれば入れ替える。 */
9
+ export declare function mountMascotCss(artwork: ArMascotArtwork): void;
@@ -0,0 +1,51 @@
1
+ /**
2
+ * ArMascot 1.0 の契約。マスコット(動くキャラクター)を表示し、名前で指定した動きを再生する。
3
+ * 絵と動きは製品が渡す(1つの SVG と、動きを書いた CSS)。部品は絵の形や色を変えず、再生の制御だけをする。
4
+ * 絵の色にテーマ色(--ar-accent など)を使うと、ページのテーマ色と利用者が選んだ色合いにそのまま従う。
5
+ */
6
+ /** 1つの動き。 */
7
+ export interface ArMascotMotion {
8
+ /** 1回の長さ(秒)。絵の CSS へ --duration として渡す。 */
9
+ seconds: number;
10
+ /** 繰り返す動きか。false は1回だけ動いて待機の動きへ戻る。 */
11
+ loop: boolean;
12
+ /** 動きの間の表情(絵の data-expression へ渡す)。絵が表情を持たないなら省く。 */
13
+ expression?: string;
14
+ }
15
+ /**
16
+ * 絵と動きの一式。製品が用意した信頼できる内容だけを渡す(部品は SVG をそのまま画面に入れる)。
17
+ * script・イベント属性・javascript: を含む SVG は表示しない。
18
+ */
19
+ export interface ArMascotArtwork {
20
+ /** 絵の名前(英小文字・数字・ハイフン)。CSS の入れ分けに使う。同じ名前には同じ CSS を渡す。 */
21
+ id: string;
22
+ /** 1つの <svg>…</svg>。部品は data-motion・data-expression・--duration をこの svg に付ける。 */
23
+ svg: string;
24
+ /** 動きの CSS。svg の data-motion="<動きの名前>" で動きを切り替える書き方にする。 */
25
+ css: string;
26
+ /** 動きの名前 → 長さと繰り返し。 */
27
+ motions: Record<string, ArMascotMotion>;
28
+ /** 待機の動きの名前。既定 "idle"。1回だけの動きが終わるとここへ戻る。 */
29
+ idle?: string;
30
+ }
31
+ export interface ArMascotProps {
32
+ /** 絵と動きの一式(SVG・CSS・動きの一覧)。製品が用意したものだけを渡す。 */
33
+ artwork: ArMascotArtwork;
34
+ /** 再生する動きの名前。artwork.motions にない名前は待機の動きにする。既定は待機の動き。 */
35
+ motion?: string;
36
+ /** 同じ動きをもう一度最初から再生したいときに、値を変える(回数など)。 */
37
+ replay?: number;
38
+ /** 繰り返すかを動きの既定から変える。 */
39
+ loop?: boolean;
40
+ /** 動きを止める。 */
41
+ paused?: boolean;
42
+ /** 読み上げる名前(「シフトくん」など)。 */
43
+ label: string;
44
+ /** 幅。数値は px。既定はデザインが決める。高さは絵の比率に従う。 */
45
+ size?: number | string;
46
+ }
47
+ export interface ArMascotEmits {
48
+ /** 1回だけの動きが終わった(このあと待機の動きに戻る)。 */
49
+ motionend: [motion: string];
50
+ }
51
+ export type ArMascotPart = "root" | "figure";
@@ -0,0 +1,14 @@
1
+ import type { ArMascotProps } from "./ArMascot.contract";
2
+ declare const __VLS_export: import("vue").DefineComponent<ArMascotProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
3
+ motionend: (motion: string) => any;
4
+ }, string, import("vue").PublicProps, Readonly<ArMascotProps> & Readonly<{
5
+ onMotionend?: ((motion: string) => any) | undefined;
6
+ }>, {
7
+ size: string | number;
8
+ paused: boolean;
9
+ loop: boolean;
10
+ motion: string;
11
+ replay: number;
12
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ declare const _default: typeof __VLS_export;
14
+ export default _default;
@@ -128,6 +128,7 @@ export { default as ArInfo } from "./components/ArInfo.vue";
128
128
  export { default as ArKanaInput } from "./components/ArKanaInput.vue";
129
129
  export { default as ArKanaText } from "./components/ArKanaText.vue";
130
130
  export { default as ArLogoSpin } from "./components/ArLogoSpin.vue";
131
+ export { default as ArMascot } from "./components/ArMascot.vue";
131
132
  export { default as ArMenuTile } from "./components/ArMenuTile.vue";
132
133
  export { default as ArMobileHeader } from "./components/ArMobileHeader.vue";
133
134
  export { default as ArMonthDayInput } from "./components/ArMonthDayInput.vue";
@@ -273,6 +274,7 @@ export type * from "./components/ArInfo.contract";
273
274
  export type * from "./components/ArKanaInput.contract";
274
275
  export type * from "./components/ArKanaText.contract";
275
276
  export type * from "./components/ArLogoSpin.contract";
277
+ export type * from "./components/ArMascot.contract";
276
278
  export type * from "./components/ArMenuTile.contract";
277
279
  export type * from "./components/ArMobileHeader.contract";
278
280
  export type * from "./components/ArMonthDayInput.contract";
@@ -135,6 +135,7 @@ export declare const contracts: {
135
135
  readonly ArKanaInput: "1.0.0";
136
136
  readonly ArKanaText: "1.0.0";
137
137
  readonly ArLogoSpin: "1.0.0";
138
+ readonly ArMascot: "1.0.0";
138
139
  readonly ArMenuTile: "1.0.0";
139
140
  readonly ArMobileHeader: "1.1.0";
140
141
  readonly ArMonthDayInput: "1.1.0";
@@ -166,7 +167,7 @@ export declare const componentNames: ArComponentName[];
166
167
  /** 見た目を持たず、デザインのライブラリが対応しなくてよい部品(並べるための基礎と仕組み)。 */
167
168
  export declare const structuralComponents: readonly ArComponentName[];
168
169
  /** デザインが見た目を用意しなければならない部品。 */
169
- export declare const designedComponents: ("ArThemeScope" | "ArUiProvider" | "ArCluster" | "ArCompact" | "ArDivider" | "ArGrid" | "ArLayout" | "ArMasonry" | "ArSplit" | "ArSplitter" | "ArStack" | "ArButton" | "ArFloatButton" | "ArIcon" | "ArLink" | "ArParagraph" | "ArSegmented" | "ArText" | "ArTitle" | "ArAffix" | "ArAnchor" | "ArBreadcrumb" | "ArDropdown" | "ArMenu" | "ArPagination" | "ArSectionMenu" | "ArSteps" | "ArStepSelect" | "ArTabs" | "ArWizard" | "ArAutoComplete" | "ArCascader" | "ArCheckbox" | "ArCheckboxGroup" | "ArChoiceCard" | "ArColorPicker" | "ArColorSwatches" | "ArDateInput" | "ArDatePicker" | "ArDateRange" | "ArDateTimeInput" | "ArDurationInput" | "ArField" | "ArForm" | "ArInputNumber" | "ArItem" | "ArMentions" | "ArOtpInput" | "ArPills" | "ArRadio" | "ArRadioGroup" | "ArRate" | "ArRichTextEditor" | "ArSelect" | "ArSlider" | "ArStepper" | "ArSubItem" | "ArSwitch" | "ArTextarea" | "ArTextInput" | "ArTimeInput" | "ArTimePicker" | "ArTimeRange" | "ArTransfer" | "ArTreeSelect" | "ArUpload" | "ArVariablePanel" | "ArWeekdayPicker" | "ArZoomControl" | "ArAvatar" | "ArAvatarGroup" | "ArBadge" | "ArCalendar" | "ArCard" | "ArCarousel" | "ArCollapse" | "ArCountdown" | "ArDescriptions" | "ArEmpty" | "ArImage" | "ArList" | "ArMapPreview" | "ArOrgChart" | "ArPdfViewer" | "ArPointerBadge" | "ArPopover" | "ArProfileCard" | "ArQRCode" | "ArRibbon" | "ArStatistic" | "ArTable" | "ArTag" | "ArTimeline" | "ArTooltip" | "ArTour" | "ArTree" | "ArTreeTable" | "ArAlert" | "ArBorderBeam" | "ArDrawer" | "ArMessage" | "ArMessageHost" | "ArModal" | "ArNotification" | "ArNotificationHost" | "ArPopconfirm" | "ArProgress" | "ArResult" | "ArSkeleton" | "ArSpin" | "ArToast" | "ArWatermark" | "ArAppFooter" | "ArAppHeader" | "ArApprovalFlow" | "ArBalloon" | "ArBottomNav" | "ArChangedValue" | "ArChip" | "ArDateView" | "ArDaySummary" | "ArDocumentBlock" | "ArEllipsis" | "ArExample" | "ArFlagGroup" | "ArFlagView" | "ArInfo" | "ArKanaInput" | "ArKanaText" | "ArLogoSpin" | "ArMenuTile" | "ArMobileHeader" | "ArMonthDayInput" | "ArPageHeading" | "ArPayslip" | "ArPayslipLine" | "ArPayslipTable" | "ArPeriodBox" | "ArPeriodNav" | "ArPunchButton" | "ArPunchPanel" | "ArSaveBar" | "ArSectionHead" | "ArShiftChart" | "ArShiftDaySheet" | "ArShiftGrid" | "ArShiftViewTable" | "ArThumbnail" | "ArTimeChart" | "ArViewOptions" | "ArYearInput" | "ArYearMonthInput" | "ArZipInput" | "ArAuthPanel" | "ArTableHeader")[];
170
+ export declare const designedComponents: ("ArThemeScope" | "ArUiProvider" | "ArCluster" | "ArCompact" | "ArDivider" | "ArGrid" | "ArLayout" | "ArMasonry" | "ArSplit" | "ArSplitter" | "ArStack" | "ArButton" | "ArFloatButton" | "ArIcon" | "ArLink" | "ArParagraph" | "ArSegmented" | "ArText" | "ArTitle" | "ArAffix" | "ArAnchor" | "ArBreadcrumb" | "ArDropdown" | "ArMenu" | "ArPagination" | "ArSectionMenu" | "ArSteps" | "ArStepSelect" | "ArTabs" | "ArWizard" | "ArAutoComplete" | "ArCascader" | "ArCheckbox" | "ArCheckboxGroup" | "ArChoiceCard" | "ArColorPicker" | "ArColorSwatches" | "ArDateInput" | "ArDatePicker" | "ArDateRange" | "ArDateTimeInput" | "ArDurationInput" | "ArField" | "ArForm" | "ArInputNumber" | "ArItem" | "ArMentions" | "ArOtpInput" | "ArPills" | "ArRadio" | "ArRadioGroup" | "ArRate" | "ArRichTextEditor" | "ArSelect" | "ArSlider" | "ArStepper" | "ArSubItem" | "ArSwitch" | "ArTextarea" | "ArTextInput" | "ArTimeInput" | "ArTimePicker" | "ArTimeRange" | "ArTransfer" | "ArTreeSelect" | "ArUpload" | "ArVariablePanel" | "ArWeekdayPicker" | "ArZoomControl" | "ArAvatar" | "ArAvatarGroup" | "ArBadge" | "ArCalendar" | "ArCard" | "ArCarousel" | "ArCollapse" | "ArCountdown" | "ArDescriptions" | "ArEmpty" | "ArImage" | "ArList" | "ArMapPreview" | "ArOrgChart" | "ArPdfViewer" | "ArPointerBadge" | "ArPopover" | "ArProfileCard" | "ArQRCode" | "ArRibbon" | "ArStatistic" | "ArTable" | "ArTag" | "ArTimeline" | "ArTooltip" | "ArTour" | "ArTree" | "ArTreeTable" | "ArAlert" | "ArBorderBeam" | "ArDrawer" | "ArMessage" | "ArMessageHost" | "ArModal" | "ArNotification" | "ArNotificationHost" | "ArPopconfirm" | "ArProgress" | "ArResult" | "ArSkeleton" | "ArSpin" | "ArToast" | "ArWatermark" | "ArAppFooter" | "ArAppHeader" | "ArApprovalFlow" | "ArBalloon" | "ArBottomNav" | "ArChangedValue" | "ArChip" | "ArDateView" | "ArDaySummary" | "ArDocumentBlock" | "ArEllipsis" | "ArExample" | "ArFlagGroup" | "ArFlagView" | "ArInfo" | "ArKanaInput" | "ArKanaText" | "ArLogoSpin" | "ArMascot" | "ArMenuTile" | "ArMobileHeader" | "ArMonthDayInput" | "ArPageHeading" | "ArPayslip" | "ArPayslipLine" | "ArPayslipTable" | "ArPeriodBox" | "ArPeriodNav" | "ArPunchButton" | "ArPunchPanel" | "ArSaveBar" | "ArSectionHead" | "ArShiftChart" | "ArShiftDaySheet" | "ArShiftGrid" | "ArShiftViewTable" | "ArThumbnail" | "ArTimeChart" | "ArViewOptions" | "ArYearInput" | "ArYearMonthInput" | "ArZipInput" | "ArAuthPanel" | "ArTableHeader")[];
170
171
  /** 説明のための情報(分類・日本語の名前)。 */
171
172
  export declare const componentMeta: Record<ArComponentName, {
172
173
  group: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@s_and_a/arrow-ui",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "ARROW シリーズ共通の Vue 3 デザインライブラリ(部品・契約・デザインの差し替えの仕組み)",
5
5
  "type": "module",
6
6
  "sideEffects": [