@s_and_a/arrow-ui 0.2.1 → 0.2.3

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;
@@ -2,6 +2,7 @@
2
2
  * ArTimeChart 1.1 の契約。時間の横棒のチャート(勤怠の月のチャート・1日のチャート)。
3
3
  * month:1行=1日。帯(通常勤務・残業・休日勤務・休憩)と、上の細い線=シフト、下の細い線=深夜。日付を押すと select(その日の大きなチャート)。
4
4
  * day:1行=1つの内容(シフト・勤務・休憩・深夜勤務)。帯の中に「18:00〜27:00」などの文字。
5
+ * stack:1日を積み上げで出す(旧 ARROW の勤怠の1日のチャート)。縦が量、横が時間。rows の順が層の順で、先頭の行(打刻の勤務)が下の1段、2つ目から(法定外・休日・深夜の割増)が上に半段ずつ重なる。kind が shift の帯は下の細い線。休憩は帯を作らず空ける。
5
6
  * 帯に乗せると「種類・時間帯・時間数」の吹き出し。時刻は 0:00 からの分(翌日の 3:00 は 1620。前日の 23:00 は -60)。
6
7
  * デザインが選べる形(ArDesign.forms.ArTimeChart):
7
8
  * - tick:"180"(既定。3時間ごとの目盛り)/"60"(1時間ごと。今の ARROW の勤怠の月のチャート。classic)。tickStep で上書きできる。
@@ -53,8 +54,8 @@ export interface ArTimeChartRow {
53
54
  tracks?: readonly ArTimeChartTrack[];
54
55
  }
55
56
  export interface ArTimeChartProps {
56
- /** month:1行=1日(日付を押せる)。day:1行=1つの内容。 */
57
- mode?: "month" | "day";
57
+ /** month:1行=1日(日付を押せる)。day:1行=1つの内容。stack:1日の積み上げ(rows の順が下からの層)。 */
58
+ mode?: "month" | "day" | "stack";
58
59
  rows: readonly ArTimeChartRow[];
59
60
  /** 横軸の範囲(分)。既定は month が [-60, 1680](前日23時〜翌4時)、day は帯から決める(前後1時間)。 */
60
61
  range?: readonly [number, number];
@@ -7,7 +7,7 @@ declare const __VLS_export: import("vue").DefineComponent<ArTimeChartProps, {},
7
7
  label: string;
8
8
  legend: boolean | readonly ArTimeChartKind[];
9
9
  labels: Partial<ArTimeChartLabels>;
10
- mode: "month" | "day";
10
+ mode: "stack" | "month" | "day";
11
11
  range: readonly [number, number];
12
12
  hint: string;
13
13
  tickStep: number;
@@ -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.3",
4
4
  "description": "ARROW シリーズ共通の Vue 3 デザインライブラリ(部品・契約・デザインの差し替えの仕組み)",
5
5
  "type": "module",
6
6
  "sideEffects": [