ds-one 0.2.5-alpha.12 → 0.2.5-alpha.13

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.
@@ -40,11 +40,15 @@ function initDeviceDetection() {
40
40
  const scalingFactor = actualWidth / designWidth;
41
41
  document.documentElement.style.setProperty("--sf", scalingFactor.toFixed(3));
42
42
  document.documentElement.style.setProperty("--sf", scalingFactor.toFixed(3));
43
+ document.documentElement.classList.add("mobile");
44
+ document.documentElement.classList.remove("desktop");
43
45
  console.log(`[DS one] Mobile device detected - ${deviceInfo.deviceType} (${deviceInfo.screenWidth}x${deviceInfo.screenHeight}), scaling factor: ${scalingFactor.toFixed(2)}`);
44
46
  } else {
45
47
  if (typeof document !== "undefined") {
46
48
  document.documentElement.style.setProperty("--sf", "1");
47
49
  document.documentElement.style.setProperty("--sf", "1");
50
+ document.documentElement.classList.add("desktop");
51
+ document.documentElement.classList.remove("mobile");
48
52
  }
49
53
  console.log(`[DS one] Desktop device detected (${deviceInfo.screenWidth}x${deviceInfo.screenHeight})`);
50
54
  }
@@ -1888,7 +1892,7 @@ Text.styles = i4`
1888
1892
  :host {
1889
1893
  display: inline;
1890
1894
  font-family: var(--typeface-regular);
1891
- font-size: calc(var(--type-size-default) * var(--sf));
1895
+ font-size: var(--type-size-default);
1892
1896
  font-weight: var(--type-weight-default);
1893
1897
  line-height: calc(var(--type-lineheight-default) * var(--sf));
1894
1898
  letter-spacing: calc(var(--type-letterspacing-default) * var(--sf));
@@ -1980,8 +1984,7 @@ Button.styles = i4`
1980
1984
  max-height: calc(var(--08) * var(--sf));
1981
1985
  border: none;
1982
1986
  cursor: pointer;
1983
- font-size: calc(var(--type-size-default) * var(--sf));
1984
- padding: 0 calc(1px * var(--sf));
1987
+ padding: 0 calc(2px * var(--sf));
1985
1988
  color: var(--button-text-color);
1986
1989
  font-family: var(--typeface-regular);
1987
1990
  }
@@ -3136,8 +3139,81 @@ DsTable.styles = i4`
3136
3139
  `;
3137
3140
  customElements.define("ds-table", DsTable);
3138
3141
 
3142
+ // dist/4-page/ds-container.js
3143
+ var Container = class extends i6 {
3144
+ render() {
3145
+ return x`<slot></slot>`;
3146
+ }
3147
+ };
3148
+ Container.styles = i4`
3149
+ :host {
3150
+ display: flex;
3151
+ width: 100%;
3152
+ max-width: 100%;
3153
+ flex-direction: column;
3154
+ box-sizing: border-box;
3155
+ }
3156
+
3157
+ /* Ensure children don't overflow */
3158
+ :host ::slotted(*) {
3159
+ max-width: 100%;
3160
+ box-sizing: border-box;
3161
+ }
3162
+
3163
+ /* Mobile: 100% width */
3164
+ @media (max-width: 820px) {
3165
+ :host {
3166
+ width: 100%;
3167
+ max-width: 100%;
3168
+ }
3169
+ }
3170
+
3171
+ /* Desktop: max-width 1000px, centered */
3172
+ @media (min-width: 821px) {
3173
+ :host {
3174
+ max-width: 1000px;
3175
+ margin-left: auto;
3176
+ margin-right: auto;
3177
+ width: 100%;
3178
+ }
3179
+ }
3180
+ `;
3181
+ customElements.define("ds-container", Container);
3182
+
3139
3183
  // dist/4-page/ds-grid.js
3140
3184
  var Grid = class extends i6 {
3185
+ connectedCallback() {
3186
+ super.connectedCallback();
3187
+ this.updateMobileClass();
3188
+ this.resizeObserver = () => {
3189
+ if (this.resizeTimeout) {
3190
+ clearTimeout(this.resizeTimeout);
3191
+ }
3192
+ this.resizeTimeout = setTimeout(() => {
3193
+ this.updateMobileClass();
3194
+ }, 100);
3195
+ };
3196
+ window.addEventListener("resize", this.resizeObserver);
3197
+ }
3198
+ disconnectedCallback() {
3199
+ super.disconnectedCallback();
3200
+ if (this.resizeObserver) {
3201
+ window.removeEventListener("resize", this.resizeObserver);
3202
+ }
3203
+ if (this.resizeTimeout) {
3204
+ clearTimeout(this.resizeTimeout);
3205
+ }
3206
+ }
3207
+ updateMobileClass() {
3208
+ const isMobile = detectMobileDevice();
3209
+ if (isMobile) {
3210
+ this.classList.add("mobile");
3211
+ this.classList.remove("desktop");
3212
+ } else {
3213
+ this.classList.add("desktop");
3214
+ this.classList.remove("mobile");
3215
+ }
3216
+ }
3141
3217
  render() {
3142
3218
  return x``;
3143
3219
  }
@@ -3151,13 +3227,13 @@ Grid.styles = i4`
3151
3227
  margin-left: 0.5px !important;
3152
3228
  display: grid;
3153
3229
  width: 1440px;
3154
- height: 360px;
3230
+ height: 1280px;
3155
3231
  grid-template-columns: repeat(auto-fill, 19px);
3156
3232
  grid-template-rows: repeat(auto-fill, 19px);
3157
3233
  gap: 1px;
3158
3234
  row-rule: calc(1px * var(--sf)) solid var(--grid-color);
3159
3235
  column-rule: calc(1px * var(--sf)) solid var(--grid-color);
3160
- outline: 1px solid black;
3236
+ outline: calc(1px * var(--sf)) solid var(--yellow);
3161
3237
  position: fixed;
3162
3238
  top: 0;
3163
3239
  left: 50%;
@@ -3170,7 +3246,7 @@ Grid.styles = i4`
3170
3246
  :host(.mobile) {
3171
3247
  width: calc(100% - calc(1px * var(--sf)));
3172
3248
  max-width: 100vw;
3173
- margin-left: 0 !important;
3249
+ margin-left: 0.5px !important;
3174
3250
  margin-top: 0 !important;
3175
3251
  box-sizing: border-box;
3176
3252
  position: fixed;
@@ -3209,58 +3285,58 @@ var Layout = class extends i6 {
3209
3285
  this.mode = "portfolio";
3210
3286
  }
3211
3287
  render() {
3212
- const isDebug = this.debug || this.mode === "debug";
3288
+ const isView = this.view || this.mode === "view";
3213
3289
  const isPortfolio = this.mode === "portfolio";
3214
3290
  const isCompany = this.mode === "company";
3215
3291
  const isApp = this.mode === "app";
3216
3292
  return x`
3217
3293
  <slot></slot>
3218
- ${isDebug ? x`
3219
- <div class="debug-overlay">
3294
+ ${isView ? x`
3295
+ <div class="view-overlay">
3220
3296
  ${isApp ? x`
3221
- <div class="debug-area debug-banner">
3297
+ <div class="view-area view-banner">
3222
3298
  <ds-text key="banner">banner</ds-text>
3223
3299
  </div>
3224
- <div class="debug-area debug-header">
3300
+ <div class="view-area view-header">
3225
3301
  <ds-text key="header">header</ds-text>
3226
3302
  </div>
3227
3303
 
3228
- <div class="debug-area debug-main">
3304
+ <div class="view-area view-main">
3229
3305
  <ds-text key="main">main</ds-text>
3230
3306
  </div>
3231
- <div class="debug-area debug-footer-app">
3307
+ <div class="view-area view-footer">
3232
3308
  <ds-text key="footer">footer</ds-text>
3233
3309
  </div>
3234
3310
  ` : isCompany ? x`
3235
- <div class="debug-area debug-header">
3311
+ <div class="view-area view-header">
3236
3312
  <ds-text key="header">header</ds-text>
3237
3313
  </div>
3238
- <div class="debug-area debug-content">
3314
+ <div class="view-area view-content">
3239
3315
  <ds-text key="content">content</ds-text>
3240
3316
  </div>
3241
- <div class="debug-area debug-footer">
3317
+ <div class="view-area view-footer">
3242
3318
  <ds-text key="footer">footer</ds-text>
3243
3319
  </div>
3244
3320
  ` : isPortfolio ? x`
3245
- <div class="debug-area debug-square">
3321
+ <div class="view-area view-square">
3246
3322
  <ds-text key="square">square</ds-text>
3247
3323
  </div>
3248
- <div class="debug-area debug-title">
3324
+ <div class="view-area view-title">
3249
3325
  <ds-text key="title">title</ds-text>
3250
3326
  </div>
3251
- <div class="debug-area debug-header">
3327
+ <div class="view-area view-header">
3252
3328
  <ds-text key="header">header</ds-text>
3253
3329
  </div>
3254
- <div class="debug-area debug-projects">
3330
+ <div class="view-area view-projects">
3255
3331
  <ds-text key="projects">projects</ds-text>
3256
3332
  </div>
3257
- <div class="debug-area debug-bio">
3333
+ <div class="view-area view-bio">
3258
3334
  <ds-text key="bio">bio</ds-text>
3259
3335
  </div>
3260
- <div class="debug-area debug-nav">
3336
+ <div class="view-area view-nav">
3261
3337
  <ds-text key="nav">nav</ds-text>
3262
3338
  </div>
3263
- <div class="debug-area debug-footer">
3339
+ <div class="view-area view-footer">
3264
3340
  <ds-text key="footer">footer</ds-text>
3265
3341
  </div>
3266
3342
  ` : ""}
@@ -3272,7 +3348,7 @@ var Layout = class extends i6 {
3272
3348
  Layout.properties = {
3273
3349
  mode: { type: String },
3274
3350
  align: { type: String },
3275
- debug: { type: Boolean }
3351
+ view: { type: Boolean }
3276
3352
  };
3277
3353
  Layout.styles = i4`
3278
3354
  :host {
@@ -3282,79 +3358,103 @@ Layout.styles = i4`
3282
3358
  }
3283
3359
 
3284
3360
  :host([mode="portfolio"]) {
3285
- grid-template-columns: 120px 480px 40px;
3286
- grid-template-rows: 120px 120px 60px 180px 60px 120px 60px 20px 120px 120px;
3287
- grid-template-areas:
3288
- "square . ."
3289
- ". title ."
3290
- ". header ."
3291
- ". projects ."
3292
- ". . ."
3293
- ". bio ."
3294
- ". . ."
3295
- ". nav ."
3296
- ". . ."
3297
- ". footer ."
3298
- ". . .";
3361
+ --portfolio-cols: 120px 480px 40px;
3362
+ --portfolio-rows: 120px 120px 60px 180px 60px 120px 60px 20px 120px 120px;
3363
+ --portfolio-areas: "square . ." ". title ." ". header ." ". projects ."
3364
+ ". . ." ". bio ." ". . ." ". nav ." ". . ." ". footer ." ". . .";
3365
+ --portfolio-overlay-cols: 120px 480px;
3366
+ --portfolio-overlay-areas: "square ." ". title" ". header" ". projects"
3367
+ ". ." ". bio" ". ." ". nav" ". ." ". footer" ". .";
3368
+ grid-template-columns: var(--portfolio-cols);
3369
+ grid-template-rows: var(--portfolio-rows);
3370
+ grid-template-areas: var(--portfolio-areas);
3299
3371
  min-height: 600px;
3300
3372
  background-color: rgba(165, 165, 165, 0.03);
3301
3373
  max-width: 640px;
3302
- margin: 0 auto;
3374
+ margin: 0;
3375
+ }
3376
+
3377
+ :host([mode="portfolio"]) .view-overlay {
3378
+ grid-template-columns: var(--portfolio-overlay-cols);
3379
+ grid-template-rows: var(--portfolio-rows);
3380
+ grid-template-areas: var(--portfolio-overlay-areas);
3303
3381
  }
3304
3382
 
3305
3383
  :host([mode="company"]) {
3306
- grid-template-columns: auto 400px auto;
3307
- grid-template-rows: 80px 20px 20px 120px 20px 120px;
3308
- grid-template-areas:
3309
- ". . ."
3310
- ". header ."
3311
- ". . ."
3312
- ". content ."
3313
- ". . ."
3384
+ --company-cols: auto 400px auto;
3385
+ --company-rows: 80px 20px 20px 120px 20px 120px;
3386
+ --company-areas: ". . ." ". header ." ". . ." ". content ." ". . ."
3314
3387
  ". footer .";
3388
+ grid-template-columns: var(--company-cols);
3389
+ grid-template-rows: var(--company-rows);
3390
+ grid-template-areas: var(--company-areas);
3315
3391
  gap: 0;
3316
3392
  max-width: 100%;
3317
3393
  }
3318
3394
 
3319
- :host([align="left"]) {
3395
+ :host([mode="company"]) .view-overlay {
3396
+ grid-template-columns: var(--company-cols);
3397
+ grid-template-rows: var(--company-rows);
3398
+ grid-template-areas: var(--company-areas);
3399
+ gap: 0;
3400
+ }
3401
+
3402
+ :host([align="left"]),
3403
+ :host([mode="portfolio"][align="left"]),
3404
+ :host([mode="company"][align="left"]),
3405
+ :host([mode="app"][align="left"]) {
3320
3406
  margin: 0;
3321
3407
  justify-self: start;
3322
3408
  }
3323
3409
 
3324
- :host([align="center"]) {
3410
+ :host([align="center"]),
3411
+ :host([mode="portfolio"][align="center"]),
3412
+ :host([mode="company"][align="center"]),
3413
+ :host([mode="app"][align="center"]) {
3325
3414
  margin: 0 auto;
3326
3415
  justify-self: center;
3327
3416
  }
3328
3417
 
3329
- :host([align="right"]) {
3418
+ :host([align="right"]),
3419
+ :host([mode="portfolio"][align="right"]),
3420
+ :host([mode="company"][align="right"]),
3421
+ :host([mode="app"][align="right"]) {
3330
3422
  margin: 0 0 0 auto;
3331
3423
  justify-self: end;
3332
3424
  }
3333
3425
 
3334
3426
  /* App mode - Base */
3335
3427
  :host([mode="app"]) {
3336
- grid-template-columns: 1fr;
3337
- grid-template-rows: calc(var(--1) * var(--sf)) 20px 1fr auto;
3338
- grid-template-areas:
3339
- "banner"
3340
- "main"
3341
- "footer";
3428
+ --app-cols: calc(var(--double) * var(--sf));
3429
+ --app-rows: calc(var(--unit) * var(--sf)) calc(var(--2) * var(--sf))
3430
+ calc(var(--unit) * var(--sf)) calc(var(--unit) * var(--sf))
3431
+ calc(var(--unit) * var(--sf));
3432
+ --app-areas: "1" "." "2" "." "3";
3433
+ --app-overlay-cols: calc(var(--oct) * var(--sf));
3434
+ --app-overlay-rows: calc(var(--unit) * var(--sf))
3435
+ calc(var(--double) * var(--sf)) calc(var(--unit) * var(--sf))
3436
+ calc(var(--unit) * var(--sf));
3437
+ --app-overlay-areas: "banner" "." "header" "." "main" "." "footer";
3438
+ grid-template-columns: var(--app-cols);
3439
+ grid-template-rows: var(--app-rows);
3440
+ grid-template-areas: var(--app-areas);
3342
3441
  min-height: 100vh;
3343
3442
  background-color: transparent;
3344
3443
  width: 100%;
3345
- margin: 0 auto;
3346
3444
  gap: 0;
3347
- }
3348
-
3349
- /* App mode - with scaling factor */
3350
- :host([mode="app"]) {
3351
3445
  max-width: calc(400px * var(--sf, 1));
3352
3446
  padding: calc(60px * var(--sf, 1)) calc(28px * var(--sf, 1))
3353
3447
  calc(9.751px * var(--sf, 1));
3354
3448
  gap: calc(28px * var(--sf, 1));
3355
3449
  }
3356
3450
 
3357
- .debug-overlay {
3451
+ :host([mode="app"]) .view-overlay {
3452
+ grid-template-columns: var(--app-overlay-cols);
3453
+ grid-template-rows: var(--app-overlay-rows);
3454
+ grid-template-areas: var(--app-overlay-areas);
3455
+ }
3456
+
3457
+ .view-overlay {
3358
3458
  position: absolute;
3359
3459
  margin-left: -1px;
3360
3460
  top: 0;
@@ -3368,37 +3468,7 @@ Layout.styles = i4`
3368
3468
  font-weight: bold;
3369
3469
  }
3370
3470
 
3371
- :host([mode="portfolio"]) .debug-overlay {
3372
- grid-template-columns: 120px 480px;
3373
- grid-template-rows: 120px 120px 60px 180px 60px 120px 60px 20px 120px 120px;
3374
- grid-template-areas:
3375
- "square ."
3376
- ". title"
3377
- ". header"
3378
- ". projects"
3379
- ". ."
3380
- ". bio"
3381
- ". ."
3382
- ". nav"
3383
- ". ."
3384
- ". footer"
3385
- ". .";
3386
- }
3387
-
3388
- :host([mode="company"]) .debug-overlay {
3389
- grid-template-columns: auto 400px auto;
3390
- grid-template-rows: 80px 20px 20px 120px 20px 120px;
3391
- grid-template-areas:
3392
- ". . ."
3393
- ". header ."
3394
- ". . ."
3395
- ". content ."
3396
- ". . ."
3397
- ". footer .";
3398
- gap: 0;
3399
- }
3400
-
3401
- .debug-area {
3471
+ .view-area {
3402
3472
  display: flex;
3403
3473
  align-items: center;
3404
3474
  justify-content: center;
@@ -3406,87 +3476,99 @@ Layout.styles = i4`
3406
3476
  font-weight: var(--type-weight-default);
3407
3477
  font-family: var(--typeface-regular);
3408
3478
  color: var(--black);
3409
- border: 1px solid red;
3479
+ border: 1px solid;
3410
3480
  opacity: 1;
3411
3481
  }
3412
3482
 
3413
- .debug-square {
3483
+ :host([mode="portfolio"]) .view-area:nth-of-type(1) {
3484
+ border-color: var(--tuned-red);
3485
+ }
3486
+ :host([mode="portfolio"]) .view-area:nth-of-type(2) {
3487
+ border-color: var(--sharp-blue);
3488
+ }
3489
+ :host([mode="portfolio"]) .view-area:nth-of-type(3) {
3490
+ border-color: var(--yellow);
3491
+ }
3492
+ :host([mode="portfolio"]) .view-area:nth-of-type(4) {
3493
+ border-color: var(--apple-green);
3494
+ }
3495
+ :host([mode="portfolio"]) .view-area:nth-of-type(5) {
3496
+ border-color: var(--pink);
3497
+ }
3498
+ :host([mode="portfolio"]) .view-area:nth-of-type(6) {
3499
+ border-color: var(--orange);
3500
+ }
3501
+ :host([mode="portfolio"]) .view-area:nth-of-type(7) {
3502
+ border-color: var(--zenith-blue);
3503
+ }
3504
+
3505
+ :host([mode="company"]) .view-area:nth-of-type(1) {
3506
+ border-color: var(--tuned-red);
3507
+ }
3508
+ :host([mode="company"]) .view-area:nth-of-type(2) {
3509
+ border-color: var(--sharp-blue);
3510
+ }
3511
+ :host([mode="company"]) .view-area:nth-of-type(3) {
3512
+ border-color: var(--yellow);
3513
+ }
3514
+
3515
+ :host([mode="app"]) .view-area:nth-of-type(1) {
3516
+ border-color: var(--tuned-red);
3517
+ }
3518
+ :host([mode="app"]) .view-area:nth-of-type(2) {
3519
+ border-color: var(--sharp-blue);
3520
+ }
3521
+ :host([mode="app"]) .view-area:nth-of-type(3) {
3522
+ border-color: var(--yellow);
3523
+ }
3524
+ :host([mode="app"]) .view-area:nth-of-type(4) {
3525
+ border-color: var(--apple-green);
3526
+ }
3527
+
3528
+ .view-square {
3414
3529
  grid-area: square;
3415
3530
  }
3416
3531
 
3417
- .debug-title {
3532
+ .view-title {
3418
3533
  grid-area: title;
3419
3534
  }
3420
3535
 
3421
- .debug-header {
3536
+ .view-header {
3422
3537
  grid-area: header;
3423
- border-color: #0000ff;
3424
3538
  }
3425
3539
 
3426
- .debug-projects {
3540
+ .view-projects {
3427
3541
  grid-area: projects;
3428
- border-color: #ffff00;
3429
3542
  }
3430
3543
 
3431
- .debug-bio {
3544
+ .view-bio {
3432
3545
  grid-area: bio;
3433
- border-color: #ff00ff;
3434
3546
  }
3435
3547
 
3436
- .debug-nav {
3548
+ .view-nav {
3437
3549
  grid-area: nav;
3438
- border-color: #00ffff;
3439
3550
  }
3440
3551
 
3441
- .debug-footer {
3552
+ .view-footer {
3442
3553
  grid-area: footer;
3443
- border-color: rgb(24, 147, 73);
3444
- background-color: rgba(127, 123, 11, 0.1);
3445
3554
  }
3446
3555
 
3447
- .debug-content {
3556
+ .view-content {
3448
3557
  grid-area: content;
3449
- border-color: rgba(71, 231, 71, 0.63);
3450
3558
  }
3451
3559
 
3452
- :host([mode="app"]) .debug-overlay {
3453
- grid-template-columns: 1fr;
3454
- grid-template-rows:
3455
- calc(var(--1) * var(--sf))
3456
- calc(var(--2) * var(--sf))
3457
- calc(var(--4) * var(--sf))
3458
- calc(var(--1) * var(--sf));
3459
- grid-template-areas:
3460
- "banner"
3461
- "header"
3462
- "main"
3463
- "footer";
3464
- }
3465
-
3466
- .debug-banner {
3560
+ .view-banner {
3467
3561
  grid-area: banner;
3468
- border-color: #daed09;
3469
- }
3470
-
3471
- .debug-header {
3472
- grid-area: header;
3473
- border-color: #0000ff;
3474
- background-color: rgba(127, 123, 11, 0.5);
3475
3562
  }
3476
3563
 
3477
- .debug-main {
3564
+ .view-main {
3478
3565
  grid-area: main;
3479
- border-color: #0000ff;
3480
- }
3481
-
3482
- .debug-footer-app {
3483
- grid-area: footer;
3484
- border-color: #ffa500;
3485
3566
  }
3486
3567
  `;
3487
3568
  customElements.define("ds-layout", Layout);
3488
3569
  export {
3489
3570
  Button,
3571
+ Container,
3490
3572
  Cycle,
3491
3573
  DateComponent,
3492
3574
  DsTable,