storybook-device-viewports 0.0.1 → 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 koralle
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.
package/README.ja.md ADDED
@@ -0,0 +1,113 @@
1
+ [English](./README.md)
2
+
3
+ # Storybook Device Viewport
4
+
5
+ Storybookで使用するための、さまざまなデバイスのビューポート設定を提供するTypeScriptライブラリです。
6
+
7
+ Apple(iPhone / iPad)とGoogle(Pixel)のデバイスに対応したプレ定義されたビューポート設定が含まれています。
8
+
9
+ ## インストール
10
+
11
+ ```bash
12
+ bun add storybook-device-viewports
13
+ ```
14
+
15
+ ## 使い方
16
+
17
+ Storybookの設定ファイルでビューポートを追加します。
18
+
19
+ ### 全デバイスを使用する場合
20
+
21
+ ```typescript
22
+ // .storybook/preview.ts
23
+ import { AWESOME_DEVICE_VIEWPORTS } from 'storybook-device-viewports';
24
+
25
+ const preview: Preview = {
26
+ parameters: {
27
+ viewport: {
28
+ viewports: AWESOME_DEVICE_VIEWPORTS,
29
+ },
30
+ },
31
+ };
32
+ ```
33
+
34
+ ### 特定のデバイスカテゴリのみを使用する場合
35
+
36
+ ```typescript
37
+ import { APPLE_MOBILE_VIEWPORTS, GOOGLE_MOBILE_VIEWPORTS } from 'storybook-device-viewports';
38
+
39
+ const preview: Preview = {
40
+ parameters: {
41
+ viewport: {
42
+ viewports: {
43
+ ...APPLE_MOBILE_VIEWPORTS,
44
+ ...GOOGLE_MOBILE_VIEWPORTS,
45
+ },
46
+ },
47
+ },
48
+ };
49
+ ```
50
+
51
+ ## 対応デバイス
52
+
53
+ ### Apple
54
+
55
+ #### iPhone
56
+
57
+ - iPhone 17 Pro Max / Pro / Air / 17
58
+ - iPhone 16 Pro Max / Pro / Plus / 16 / 16e
59
+ - iPhone 15 Pro Max / Pro / Plus / 15
60
+ - iPhone 14 Pro Max / Pro / Plus / 14
61
+ - iPhone 13 Pro Max / Pro / 13 / Mini
62
+ - iPhone 12 Pro Max / Pro / 12 / Mini
63
+ - iPhone 11 Pro Max / Pro / 11
64
+ - iPhone XS Max / XS / XR / X
65
+ - iPhone 8 Plus / 8
66
+ - iPhone 7 Plus / 7
67
+ - iPhone 6s Plus / 6s
68
+ - iPhone SE (2022 / 2020 / 初代)
69
+
70
+ #### iPad
71
+
72
+ **iPad Pro**
73
+ - 13" (第7世代 / 初代)
74
+ - 11" (第7世代 / 第3世代)
75
+ - 12.9" (第6世代 / 初代)
76
+ - 10.5" (第2世代)
77
+ - 9.7" (初代)
78
+
79
+ **iPad Air**
80
+ - 13" (第6世代)
81
+ - 11" (第6世代)
82
+ - 第5世代 / 第4世代 / 第3世代 / 第2世代
83
+
84
+ **iPad**
85
+ - 第10世代 / 第9世代 / 第8世代 / 第7世代 / 第6世代 / 第5世代
86
+
87
+ **iPad mini**
88
+ - 第7世代 / 第6世代 / 第5世代 / 第4世代
89
+
90
+ ### Google (Pixel)
91
+
92
+ - Pixel 9
93
+ - Pixel 8 Pro / 8
94
+ - Pixel 7 Pro / 7 / 7a
95
+ - Pixel 6 Pro / 6
96
+ - Pixel 5
97
+ - Pixel 4 XL / 4
98
+ - Pixel 3 XL / 3a XL / 3a / 3
99
+ - Pixel 2 XL / 2
100
+ - Pixel XL / Pixel
101
+
102
+ ## エクスポート一覧
103
+
104
+ | エクスポート | 説明 |
105
+ |------------|------|
106
+ | `AWESOME_DEVICE_VIEWPORTS` | 全デバイスのビューポート設定 |
107
+ | `APPLE_MOBILE_VIEWPORTS` | iPhoneのビューポート設定 |
108
+ | `APPLE_TABLET_VIEWPORTS` | iPadのビューポート設定 |
109
+ | `GOOGLE_MOBILE_VIEWPORTS` | Pixelのビューポート設定 |
110
+
111
+ ## ライセンス
112
+
113
+ MIT
package/README.md CHANGED
@@ -1,45 +1,113 @@
1
- # storybook-device-viewports
1
+ [日本語版](./README.ja.md)
2
2
 
3
- ## ⚠️ IMPORTANT NOTICE ⚠️
3
+ # Storybook Device Viewport
4
4
 
5
- **This package is created solely for the purpose of setting up OIDC (OpenID Connect) trusted publishing with npm.**
5
+ A TypeScript library providing viewport configurations for various devices to use with Storybook.
6
6
 
7
- This is **NOT** a functional package and contains **NO** code or functionality beyond the OIDC setup configuration.
7
+ Includes predefined viewport settings for devices from Apple (iPhone / iPad) and Google (Pixel).
8
+
9
+ ## Installation
8
10
 
9
- ## Purpose
11
+ ```bash
12
+ bun add storybook-device-viewports
13
+ ```
10
14
 
11
- This package exists to:
12
- 1. Configure OIDC trusted publishing for the package name `storybook-device-viewports`
13
- 2. Enable secure, token-less publishing from CI/CD workflows
14
- 3. Establish provenance for packages published under this name
15
+ ## Usage
15
16
 
16
- ## What is OIDC Trusted Publishing?
17
+ Add viewports in your Storybook configuration file.
17
18
 
18
- OIDC trusted publishing allows package maintainers to publish packages directly from their CI/CD workflows without needing to manage npm access tokens. Instead, it uses OpenID Connect to establish trust between the CI/CD provider (like GitHub Actions) and npm.
19
+ ### To use all devices
19
20
 
20
- ## Setup Instructions
21
+ ```typescript
22
+ // .storybook/preview.ts
23
+ import { AWESOME_DEVICE_VIEWPORTS } from 'storybook-device-viewports';
21
24
 
22
- To properly configure OIDC trusted publishing for this package:
25
+ const preview: Preview = {
26
+ parameters: {
27
+ viewport: {
28
+ viewports: AWESOME_DEVICE_VIEWPORTS,
29
+ },
30
+ },
31
+ };
32
+ ```
23
33
 
24
- 1. Go to [npmjs.com](https://www.npmjs.com/) and navigate to your package settings
25
- 2. Configure the trusted publisher (e.g., GitHub Actions)
26
- 3. Specify the repository and workflow that should be allowed to publish
27
- 4. Use the configured workflow to publish your actual package
34
+ ### To use specific device categories only
28
35
 
29
- ## DO NOT USE THIS PACKAGE
36
+ ```typescript
37
+ import { APPLE_MOBILE_VIEWPORTS, GOOGLE_MOBILE_VIEWPORTS } from 'storybook-device-viewports';
30
38
 
31
- This package is a placeholder for OIDC configuration only. It:
32
- - Contains no executable code
33
- - Provides no functionality
34
- - Should not be installed as a dependency
35
- - Exists only for administrative purposes
39
+ const preview: Preview = {
40
+ parameters: {
41
+ viewport: {
42
+ viewports: {
43
+ ...APPLE_MOBILE_VIEWPORTS,
44
+ ...GOOGLE_MOBILE_VIEWPORTS,
45
+ },
46
+ },
47
+ },
48
+ };
49
+ ```
36
50
 
37
- ## More Information
51
+ ## Supported Devices
38
52
 
39
- For more details about npm's trusted publishing feature, see:
40
- - [npm Trusted Publishing Documentation](https://docs.npmjs.com/generating-provenance-statements)
41
- - [GitHub Actions OIDC Documentation](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect)
53
+ ### Apple
42
54
 
43
- ---
55
+ #### iPhone
44
56
 
45
- **Maintained for OIDC setup purposes only**
57
+ - iPhone 17 Pro Max / Pro / Air / 17
58
+ - iPhone 16 Pro Max / Pro / Plus / 16 / 16e
59
+ - iPhone 15 Pro Max / Pro / Plus / 15
60
+ - iPhone 14 Pro Max / Pro / Plus / 14
61
+ - iPhone 13 Pro Max / Pro / 13 / Mini
62
+ - iPhone 12 Pro Max / Pro / 12 / Mini
63
+ - iPhone 11 Pro Max / Pro / 11
64
+ - iPhone XS Max / XS / XR / X
65
+ - iPhone 8 Plus / 8
66
+ - iPhone 7 Plus / 7
67
+ - iPhone 6s Plus / 6s
68
+ - iPhone SE (2022 / 2020 / 1st Gen)
69
+
70
+ #### iPad
71
+
72
+ **iPad Pro**
73
+ - 13" (7th Gen / 1st Gen)
74
+ - 11" (7th Gen / 3rd Gen)
75
+ - 12.9" (6th Gen / 1st Gen)
76
+ - 10.5" (2nd Gen)
77
+ - 9.7" (1st Gen)
78
+
79
+ **iPad Air**
80
+ - 13" (6th Gen)
81
+ - 11" (6th Gen)
82
+ - 5th Gen / 4th Gen / 3rd Gen / 2nd Gen
83
+
84
+ **iPad**
85
+ - 10th Gen / 9th Gen / 8th Gen / 7th Gen / 6th Gen / 5th Gen
86
+
87
+ **iPad mini**
88
+ - 7th Gen / 6th Gen / 5th Gen / 4th Gen
89
+
90
+ ### Google (Pixel)
91
+
92
+ - Pixel 9
93
+ - Pixel 8 Pro / 8
94
+ - Pixel 7 Pro / 7 / 7a
95
+ - Pixel 6 Pro / 6
96
+ - Pixel 5
97
+ - Pixel 4 XL / 4
98
+ - Pixel 3 XL / 3a XL / 3a / 3
99
+ - Pixel 2 XL / 2
100
+ - Pixel XL / Pixel
101
+
102
+ ## Export List
103
+
104
+ | Export | Description |
105
+ |--------|-------------|
106
+ | `AWESOME_DEVICE_VIEWPORTS` | Viewport settings for all devices |
107
+ | `APPLE_MOBILE_VIEWPORTS` | iPhone viewport settings |
108
+ | `APPLE_TABLET_VIEWPORTS` | iPad viewport settings |
109
+ | `GOOGLE_MOBILE_VIEWPORTS` | Pixel viewport settings |
110
+
111
+ ## License
112
+
113
+ MIT